Home Forums WinForms controls Xceed Grid for WinForms Calculated Column Reply To: Calculated Column

User (Old forums)
Member
Post count: 23064

You can use the SiblingValueChanged event on the cell to accomplish this. This event is triggered for every cell of the row in which one cell value is changed. It is also triggered when binding/refreshing the grid, so you may want to set a flag when first loading the data so that the event handler does not do anything, unless you also need to do your calculation when first loading the data into the grid.

e.g.:

//at form_load

private void Form1_Load(object sender, System.EventArgs e)
{
foreach( DataCell cell in dataRowTemplate1.Cells )
{
cell.SiblingValueChanged += new EventHandler(cell_SiblingValueChanged);
}

binding = true;
oleDbDataAdapter1.Fill( dataSet11 );
binding = false;
}

//Event handler

private static bool binding;

private void cell_SiblingValueChanged(object sender, EventArgs e)
{
if( !binding )
System.Diagnostics.Debug.WriteLine( ( ( Cell )sender).Value.ToString() );
}

Imported from legacy forums. Posted by André (had 2940 views)