We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Covered ranges in databound grid

Hi Haneef,
We are using the data bound grid and we need the covered ranges to show header inforamtion. Pls see the sample.Many Thanks in advance.

Covered Ranges in DataBoundGrid.zip

3 Replies

HA haneefm Syncfusion Team July 13, 2007 03:25 PM UTC

Hi Anand,

The GDBGMultiHeader broswer sample shows you how to have multiple row and / or column headers in your GridDataBoundGrid as well as additional unbound rows or columns. It has a couple of fixed rows at the top of the grid that show a variety of controls such as comboboxes, dropdownlists, checkboxes and buttons. It is also an unbound checkbox column which, is on the left side of the grid that affects the display of the values which, are in that row.

Sample : C:\Documents and Settings\haneefm\My Documents\Syncfusion\EssentialStudio\5.1.1.0\Windows\Grid.Windows\Samples\2.0\DataBound\GDBGMultiHeader\cs

Best regards,
Haneef


AN Anand July 19, 2007 12:47 PM UTC

Hi Haneef,
Thanks a lot for the sample. Things are working fine for me except that the extra row header is coming as second row header. I want it to be above the datasource column headers i.e at the zeroth row.
Thanks a lot in advance.


HA haneefm Syncfusion Team July 19, 2007 06:20 PM UTC

Hi Anand,

By default, Extra header row placed below the column header row. One way you can change the appearance of the row by using the CoveredRange and column's HeaderText. First you can try setting the column header text of all column to String.Empty and add covered ranges in the column header to make your required look. And you can set the cellvalue of the extra row by using the column name in a datasource. Below is a code snippet that show this task.

foreach(GridBoundColumn column in this.grid.Binder.InternalColumns)
{
column.HeaderText = String.Empty;
}
this.grid.Model.CoveredRanges.Add(GridRangeInfo.Cells(0,1,0,3)); // first three cell act as one cell.
this.grid.Model.CoveredRanges.Add(GridRangeInfo.Cells(0,4,0,5));

int i =1;
foreach(GridBoundColumn column in this.grid.Binder.InternalColumns)
{
this.grid.Model[1,i].Text = column.MappingName;
i++;
}

Best regards,
Haneef

Loader.
Live Chat Icon For mobile
Up arrow icon