View Single Post
Old Jun 19th, 2005, 11:46 AM   #2
ykasan
Newbie
 
Join Date: Jun 2005
Location: NJ
Posts: 2
Rep Power: 0 ykasan is on a distinguished road
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
Attached Files
File Type: zip BindControls.zip (29.0 KB, 34 views)

Last edited by ykasan; Jun 19th, 2005 at 12:03 PM.
ykasan is offline   Reply With Quote