|
ItemArray problem
ItemArray in DataTable serves the different purpose.
To change a column value in DataTable use the following technique:
DataTable dt = (DataTable)dataGrid1.DataSource;
DataRow rCurrent = dt.Rows.Find("col11");
rCurrent[3]="Test";
dt.AcceptChanges();
Or if you still want to use ArrayList then you should use this:
DataTable dt=(DataTable)dataGrid1.DataSource;
DataRow rCurrent = dt.Rows.Find("col11");
object[] test = new object[4]{"1","2","3","4"};
rCurrent.ItemArray=test;
dt.AcceptChanges();
For your convinience I added a sample c# project which demonstrates all of the abowe.
Sincerely, Yuri
Last edited by ykasan; Jun 19th, 2005 at 12:03 PM.
|