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

Column Name..

Hi I want to detech whether a user''s key down is on a particular column. My codes is currently like this. If ggcOrderProfileTestResults.TableControl.CurrentCell.ColIndex = 6 Then But i think i will detech error if user use sorting on the grid then the colindex wil run. ANyone can tell me how to code such that.. i get the colName instead of the colindex?

3 Replies

AC Angela Chua October 20, 2004 01:13 AM UTC

by the way, i need to capture this under gridgrouping_validating event. thankz


AD Administrator Syncfusion Team October 20, 2004 05:28 AM UTC

Here is a snippet that shows how to get the column name (and other values) in theTableControlCUrrentCellValidating event.
private void gridGroupingControl1_TableControlCurrentCellValidating(object sender, GridTableControlCancelEventArgs e)
{
	GridCurrentCell cc = e.TableControl.CurrentCell;
	Console.WriteLine("new: {0}     old: {1}", cc.Renderer.ControlText, e.TableControl.Model[cc.RowIndex, cc.ColIndex].CellValue);
	GridTableCellStyleInfo style = e.TableControl.Model[cc.RowIndex, cc.ColIndex] as GridTableCellStyleInfo;
	if(style != null)
	{
		Console.WriteLine("column: {0}", style.TableCellIdentity.Column.Name);
	}
}


AC Angela Chua October 20, 2004 10:53 PM UTC

Thankz.. it works well..

Loader.
Up arrow icon