AD
Administrator
Syncfusion Team
June 29, 2006 09:33 PM UTC
Hi Michael,
The Populate method gives you an easy way to copy the data from any given datasource that implements the IList interface or is an Array to the specified range of cells in the Grid. It doesn''t configure the grid (ie it doesn''t set the RowCount/ColCount/Style property of the grid). If you want to configure the grid, you can set those property explictly. Here is a code snippet.
if (numDefects == 0)
{
this.gridCtl.BeginUpdate();
int [,] grid = new int[2, 2];
for (int i = 0; i < 2; i++)
for (int j = 0; j < 2; j++)
grid[i,j] = 0;
this.gridCtl.Model.PopulateValues(
GridRangeInfo.Cells(0, 0, 2, 2), grid );
//Set the RowCount AND Colcount
this.gridCtl.RowCount = 1;
this.gridCtl.ColCount = 1;
this.gridCtl.EndUpdate();
this.gridCtl.Refresh();
this.gridCtl.Invalidate();
return;
}
Let me know if this helps,
Best Regards,
Haneef