hwo to add rows in datagridview using csharp in windows appl
i have tow date picker as follows.
Datepicker1 DAtepicker2
when i choose datepicker1 8th day as monday in the datepicker 2 13th day saturday automically display in the datepicker2 no problem.
i want the output as
that 8th to 13th date will be diplayed in the row wise as follows.when i click the button.
what date i choose in the datepicker1 add 5 days and display that date to the datepicker2.when i click the load button that date to be displayed in the row wise in the date grid view.
output as follows
DAte SS GS VR CKK CNN RV MS TSS CM
8 1
8 2
8 3
9 1
9 2
9 3
10 1
10 2
10 3
11 1
11 2
11 3
12 1
12 2
12 3
13 1
13 2
13 3
for that output how to write the code using csharp in windows application.
venkata kumarPosted Jan 7, 2013, 12:09 AM
in properties u can change
allowusertoaddrows=false;
ResultGV.Rows.Add();
Jignesh TrivediPosted Jan 6, 2013, 11:05 PM
one of the best way to update data grid or add new row in data grid @ run time, is update datasource of that grid.
DataSet ds = new DataSet();
// write code fill data set
dataGridView1.DataSource = ds.Table(0);
on click of button add row to table 0 of dataset
var drow = ds.Table(0).NewRow();
drow.ItemArray = new object[] {"Disp01","Item01",1,"2","2nd Floor",0,0}; // item to be add per no of column in data table.
ds.Table(0).Rows.Add(drow);
hope this will help you.