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
close icon

CellClick vs QueryCellInfo

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?

5 Replies

AD Administrator Syncfusion Team November 15, 2005 01:30 PM UTC

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


AD Administrator Syncfusion Team 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 }


BK Babak Keradman November 15, 2005 02:10 PM UTC

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


AD Administrator Syncfusion Team 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;
		Console.WriteLine(colName);
	}
}


BK Babak Keradman November 15, 2005 05:12 PM UTC

that worked beautifully!!!

Loader.
Live Chat Icon For mobile
Up arrow icon