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.
Syncfusion Feedback

GGC TableControlMouseDown Table Level

Thread ID:

Created:

Updated:

Platform:

Replies:

38064 Dec 5,2005 04:36 PM UTC Dec 5,2005 06:35 PM UTC Windows Forms 2
loading
Tags: GridControl
Administrator [Syncfusion]
Asked On December 5, 2005 04:36 PM UTC

Is there a way to check the level of the record (child or parent) in TableControlMouseDown event handler without checking TableCellIdentity.Table.TableDescriptor.Name? Thank you.

Administrator [Syncfusion]
Replied On December 5, 2005 06:26 PM UTC

You can use code like:
private void gridGroupingControl1_TableControlMouseDown(object sender, GridTableControlMouseEventArgs e)
{
	Element el = this.gridGroupingControl1.TableControl.PointToNestedDisplayElement(new Point(e.Inner.X, e.Inner.Y));
	Console.WriteLine(GetLevelFromTableControl(el.ParentTableDescriptor.Name));
}
private int GetLevelFromTableControl(string name)
{
	int i = 0;
	GridTableDescriptor td = this.gridGroupingControl1.TableDescriptor;
	while(td != null && td.Name != name)
	{
		i++;
		if(td.Relations != null && td.Relations.Count > 0)
			td = td.Relations[0].ChildTableDescriptor;
		else
			td = null;
	}
	return i;
}
 

Administrator [Syncfusion]
Replied On December 5, 2005 06:35 PM UTC

Thank you! This works perfectly

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.

Warning Icon 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.Close Icon

;