0
votes

I wonder if there is an option to add rows in devexpress GridControl ,I have a datasource from database but i need add first row Manual then add datasores. It can be done in a normal datagridview Like this :


Dim I = datagridview1.Row.add
datagridview1.row.add(i).Cells(1).Value="test"

*********************

**** fill gridview1 from database
Dim h dt.Rows.Count
For M=0 to dt.Rows.Conunt-1
     Dim f = datagridview1.Rows.add
           datagridview1.Rows(f).Cells(0).value=dt.Rows(M).Item
 Next ```
1
Thing you want to look at the GridView.AddNewRow() method. And please check you tags. is it C# or vb.Net? - Hursey

1 Answers

0
votes

Of course. Your code should be something like this:

 datagridview1.AddNewRow()
 datagridview1.SetRowCellValue(gridView1.RowCount - 1; , datagridview1.Columns(0), 'A')  
 datagridview1.SetRowCellValue(gridView1.RowCount - 1; , datagridview1.Columns(0), 'B')  
 datagridview1.SetRowCellValue(gridView1.RowCount - 1; , datagridview1.Columns(0), 'C')