AD
Administrator
Syncfusion Team
November 27, 2007 08:55 AM UTC
If you are referring to GridControl and GridDataBoundGrid, they do derived from the same class GridControlBase. They do both have the same property grid.Model which does hold lots of common properties. Their main difference is that one is a cell oriented grid (storing all information and properties on a cell by cell basis in its own data cache) and the other is a bound, column oriented grid which does not have a local datastore setup to store any information on a cell by cell basis. The idea is that for bound data which might be millions of records with similar data in each column, there is no need to allocate the overhead required to manage cell by cell data in such cases.
If you want to see the row numbers in a GridDataBoundGrid, here is one way. Subscribe to the Model.QueryCellStyleInfo event.
this.gridDataBoundGrid1.Model.QueryCellInfo += new GridQueryCellInfoEventHandler(Model_QueryCellInfo);
Then use code like this in the handler.
void Model_QueryCellInfo(object sender, GridQueryCellInfoEventArgs e)
{
if (e.RowIndex > 0 && e.ColIndex == 0)
{
e.Style.CellType = "Header";
e.Style.Text = e.RowIndex.ToString();
e.Style.Font.Bold = false;
}
e.Style.CellTipText = e.Style.CellType;
}