gl3nt0n Posted January 12, 2005 Posted January 12, 2005 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. Quote
RobEmDee Posted January 12, 2005 Posted January 12, 2005 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 "". Quote
donnacha Posted January 14, 2005 Posted January 14, 2005 I believe you can do it directly by DGStats(j,i) = string.Empty; but you may have to force the binding afterwards Quote Hamlet
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.