Home Forums WinForms controls Xceed Grid for WinForms Add New Row – Urgent Reply To: Add New Row – Urgent

Xceed Support
Member
Post count: 5658

I think you are referring to the InsertionRow. However, the main way to add a row to an unbound grid is to use the AddNew() method from the DataRows collection.

Here is some sample code:

<code>
for( int j = 0; j < 4; j++ )
{
Column col = new Column( “Column”+j.ToString() );
gridControl1.Columns.Add( col );
}

for( int i = 0; i < 20; i++ )
{
Xceed.Grid.DataRow row = gridControl1.DataRows.AddNew();
foreach( Cell cell in row.Cells )
{
cell.Value = “Item ” + i.ToString();
}
row.EndEdit();
}
</code>

Imported from legacy forums. Posted by CharlesB (had 3443 views)