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

Problem with covered header cells in virtual grid

Hi, I experienced a problem with covered cells in the header row when using the grid in virtual mode. I''m using the QueryCoveredRange event to cover each four cells in the header row to one cell. Now, if the the mouse cursor is moved over one of these cells (except of every first cell in the covered range) then the underlaying cell is activated and breaks the covered cell''s text. If the mouse cursor is moved to the first cell in the covered range then the cell gets redrawn and everything looks fine. How to get rid of this? I attached a zip-file containing a sample project and a screenshot to this post. Thanks in advance Holger Persch VirtualGridTest_2037.zip

2 Replies

AD Administrator Syncfusion Team June 14, 2005 06:18 AM

When you use QueryCoveredRange, any time e.RowIndex and e.COlIndex point yo any cell in a desired covered range, you must explicilty specify the range. (ie, you just do not specify the range for the top-left cell, instead you need to specify the range for every cell in the range). So, try this code (I may have the arithmetic wrong, but it shows the idea.)
private void gridControl1_QueryCoveredRange(object sender, GridQueryCoveredRangeEventArgs e)
{
	e.Handled = false;
	if (e.RowIndex == 0 && e.ColIndex > 0)
	{
		int start = 4 * ((e.ColIndex - 1) / 4) + 1;
		e.Range = GridRangeInfo.Cells(0, start, 0, start + 3);
		e.Handled = true;
	}
}


HP Holger Persch June 14, 2005 06:39 AM

Hi, Your code works perfectly and mine now too :-) Thanks Holger

Loader.
Live Chat Icon For mobile
Up arrow icon