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

How can I make Column Header to cover two columns for Virtual Grid?

We are using virtual grid. Right now we are too far in the application process to use any other grid.

I have looked at several post and knowledge base articles but was not able to find any info on having column header cover 2 columns.

I looked at
http://www.syncfusion.com/Support/Forums/message.aspx?&MessageID=14991

I have a similar requirement but with "virtual" grid.

Is there a sample?

Help appreciated

1 Reply

SA Saravanan A Syncfusion Team May 16, 2007 04:16 PM UTC

Hi TOO1BEE,

You can achieve this by having a covered cell in the column header that span over two columns. For that, you would have to subscribe to the QueryCoveredRange event and provide the covered range on demand.

Here is the code snippet to have a column header that covers first two columns.

//provide covered range on demand
void gridControl1_QueryCoveredRange(object sender, GridQueryCoveredRangeEventArgs e)
{
if (e.RowIndex == 0)
{
if (e.ColIndex >= 1 && e.ColIndex <= 2)
{
e.Range = GridRangeInfo.Cells(0, 1, 0, 2);
e.Handled = true;
}
}
}

Please refer to this sample: http://websamples.syncfusion.com/samples/Grid.Windows/F60992/main.htm

Best Regards,
Saravanan

Loader.
Live Chat Icon For mobile
Up arrow icon