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

ColumnHeader Double Click

Thread ID:





22249 Dec 7,2004 09:40 PM UTC Dec 8,2004 07:20 AM UTC WinForms 1
Tags: Grouping
Bernard Herrok
Asked On December 7, 2004 09:40 PM UTC

Hi, I want to capture what column header was double clicked. I''m using the TableControlCellDoubleClick event, which has the GridTableControlCellClickEventArgs. The options i get are Inner and TableControl. The thing is when i chose inner, it gives me the wrong column index and if i chose tablecontrol.currentcell i get -1 for rowindex and colindex, because nothing''s selected obviously. How do i get the column index of the column header the users'' clicked on? i also need to check if it''s the column header that''s been clicked (rowindex = 0). thanks in advanced!

Administrator [Syncfusion]
Replied On December 8, 2004 07:20 AM UTC

For me, I could not get TableControlCellDoubleClick to be raised on header cells. I might have differernt properties set than you do. But I was able to use TableControlMouseDown and look for 2 leftclicks. In that event, you can test for a header row and get teh column clicked using code like:
private void gridGroupingControl1_TableControlMouseDown(object sender, GridTableControlMouseEventArgs e)
	if(e.Inner.Clicks == 2 && e.Inner.Button == MouseButtons.Left)
		int row, col;
		Point pt = new Point(e.Inner.X, e.Inner.Y);
		if(e.TableControl.PointToRowCol(pt, out row, out col))
			GridColumnHeaderRow headerRow = e.TableControl.Table.DisplayElements[row] as GridColumnHeaderRow;
			if(headerRow != null)
				int pos = e.TableControl.TableDescriptor.ColIndexToField(col);
				string colName = e.TableControl.TableDescriptor.VisibleColumns[pos].Name;


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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

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

Live Chat Icon For mobile
Live Chat Icon