Datatable dt = new datatable (); DT. columns. add ("name1", typeof (INT); DT. columns. add ("name2", typeof (object); DT. columns. add ("name3", typeof (object); For (INT I = 0; I <200; I ++) {DT. rows. add (I, "payment no." + convert. tostring (I), "color number" + convert. tostring (I);} gridcontrol1.datasource = DT;
___________________________________________________________________________________________________________
========================================================== ========================================================== ======================================
Datatable dt = new datatable (); DT. columns. add ("name1", typeof (INT); DT. columns. add ("name2", typeof (object); DT. columns. add ("name3", typeof (object); For (INT I = 0; I <200; I ++) {DT. rows. add (I, "payment no." + convert. tostring (I), "color number" + convert. tostring (I);} gridcontrol1.datasource = DT;
Datatable adds a column and assigns corresponding values to the column