Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

hey folks!

 

i'm trying to clear some cells in a datagrid, and can't figure out how to do it. here's what i got so far :

 

//clear the three last columns
for (i=3;i<=5;i++)
 {
   for (j=1; j<=4;j++)
     {
       DGStats.CurrentCell = new DataGridCell(j, i);
       DGStats.Text = string.Empty;
     }
 }

 

in vb6 this approach used to work: setting row and column, and then setting the text property. but in .NET i'm kinda lost.

 

such a simple task ...

 

thanks for any insight you ay have,

 

G.

Posted

gl3nt0n:

 

You need to manipulate the DataSource that the DataGrid is bound to.....for example, if the DataGrid is bound to a DataTable, loop through the DataRows in the table and set the DataColumn values you would like to clear to "".

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...