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

Finding out current row in grid

Thread ID:

Created:

Updated:

Platform:

Replies:

23350 Jan 10,2005 06:17 PM UTC Jan 10,2005 11:38 PM UTC Windows Forms 1
loading
Tags: GridControl
Anthony Avella
Asked On January 10, 2005 06:17 PM UTC

I am using your newest grid (3....). I have created an event handler for the grid.ContextMenu.Popup event. Based on the row the user is in, we are trying to determine which items on the menu we''d like to make available to the user. While in this event handler, is there any way to determine the row that has been clicked when the mouse has been right clicked to bring up the popup menu? More specifically, I need to know: 1- Have I clicked on a summary/group by row? 2- If the anwser to the above question is yes, what level in my grouping scheme (first group by column, second group by column, etc..) am I in when I brought up the menu? thanks

Administrator [Syncfusion]
Replied On January 10, 2005 11:38 PM UTC

You can handle the TableControlMouseDown event and track the GridTableCellStyleInfo for the clicked cell. Then in your menuhandler, you can access the TableCellIdentity for this saved style. This object has complete information for the clicked record which you can access through the DisplayElement.
GridTableCellStyleInfo mouseDownCellStyle = null;
private void gridGroupingControl1_TableControlMouseDown(object sender, GridTableControlMouseEventArgs e)
{
	int row, col;
	if(e.TableControl.PointToRowCol(new Point(e.Inner.X, e.Inner.Y), out row, out col))
	{
		mouseDownCellStyle = e.TableControl.Model[row, col];
	}
	else
		mouseDownCellStyle = null;
}

private void menuItem1_Click(object sender, System.EventArgs e)
{
	Console.WriteLine(this.mouseDownCellStyle.TableCellIdentity.Info);
	//this.mouseDownCellStyle.TableCellIdentity.DisplayElement
}

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

;