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.
Unfortunately, activation email could not send to your email. Please try again.

Nested Headers

Thread ID:

Created:

Updated:

Platform:

Replies:

11201 Feb 26,2004 09:10 AM Feb 26,2004 01:32 PM Windows Forms 3
loading
Tags: GridControl
Rajesh Venkataraman
Asked On February 26, 2004 09:10 AM

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

Administrator [Syncfusion]
Replied On 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....
	}
}

Rajesh Venkataraman
Replied On 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....
>	}
>}
>

Administrator [Syncfusion]
Replied On 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''

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;