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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

CellClick vs QueryCellInfo

Thread ID:





37056 Nov 15,2005 01:25 PM UTC Nov 15,2005 05:12 PM UTC WinForms 5
Tags: GridControl
Babak Keradman
Asked On November 15, 2005 01:25 PM UTC

I am trying to change the text of a label on the form when a user click any cell in a particular column. What is the best way to trigger this event? How can I tell what column the current cell is in?

Administrator [Syncfusion]
Replied On November 15, 2005 01:30 PM UTC

Try handling the grid.CellClick event. e.ColIndex should give you the column index.

Administrator [Syncfusion]
Replied On November 15, 2005 01:44 PM UTC

If you are using a GridDataBoundGrid, you can use grid.Binder.NameToColIndex to test if e.ColIndex has a particular column name. if(grid.Binder.NameToColindex(e.ColIndex) == "TheColumn") { //clicked TheColumn }

Babak Keradman
Replied On November 15, 2005 02:10 PM UTC

I am using a GridGroupingControGrid, I can''t seem to find the property "Binder" ?

Administrator [Syncfusion]
Replied On November 15, 2005 03:20 PM UTC

In a GridGroupingControl, you can try using the TableControlCellClick event.
private void grid_TableControlCellClick(object sender, GridTableControlCellClickEventArgs e)
	GridTableCellStyleInfo style = e.TableControl.GetTableViewStyleInfo(e.Inner.RowIndex, e.Inner.ColIndex);
	if(style.TableCellIdentity.TableCellType == GridTableCellType.ColumnHeaderCell)
		string colName = style.TableCellIdentity.Column.Name;

Babak Keradman
Replied On November 15, 2005 05:12 PM UTC

that worked beautifully!!!


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