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

Nested Headers

Hi, I need to create nested row and column headers. I could do these using Model.CoveredRanges.Add(GridRangeInfo) and passing in the cells required. Is there any mechanism by which by clicking on an header cell, you can find the parent of the nested header cell. I appreciate your help Thanks

3 Replies

AD Administrator Syncfusion Team February 26, 2004 10:04 AM

Here is a snippet that should give you the top-left cell of a covered range if the mouse is over any part of the coveredrange.
Point pt = this.gridControl1.PointToClient(Control.MousePosition);
int row, col;
if(this.gridControl1.PointToRowCol(pt, out row, out col, -1))
{
	GridRangeInfo range = this.gridControl1.CoveredRanges.FindRange(row, col);
	if(!range.IsEmpty)
	{
		//range.Top and range.Left hold the top corner of covered range of teh click....
	}
}


RV Rajesh Venkataraman February 26, 2004 10:58 AM

The snippet gives you the coordinates of the cell that is clicked on. But lets assume that we have a 2 row headers, the outer one (lets say "A") spanning 2 cells, and the inner ones(lets say "B" and "C") each spanning 1 cell. If I click on "B", I would like to know what are the coordinates of "A". I need to know the range at the immediate higher level to the cell that is clicked on. Is there any way that this can be done. Also is it possible to associate any kind of an object with a header cell ? Thanks, >Here is a snippet that should give you the top-left cell of a covered range if the mouse is over any part of the coveredrange. > >
>Point pt = this.gridControl1.PointToClient(Control.MousePosition);
>int row, col;
>if(this.gridControl1.PointToRowCol(pt, out row, out col, -1))
>{
>	GridRangeInfo range = this.gridControl1.CoveredRanges.FindRange(row, col);
>	if(!range.IsEmpty)
>	{
>		//range.Top and range.Left hold the top corner of covered range of teh click....
>	}
>}
>


AD Administrator Syncfusion Team February 26, 2004 01:32 PM

>>The snippet gives you the coordinates of the cell that is clicked on. Once you have the row and col of teh clicked cell, if the clicked row is one below a ''parent row'', then check if there is a covered range holding the cell (row-1, col) by using the code above. If there is such a range, then the top-left cell of the range will be your ''parent covered cell''

Loader.
Live Chat Icon For mobile
Up arrow icon