Home › Forums › WinForms controls › Xceed Grid for WinForms › DataRowsChanged event › Reply To: DataRowsChanged event
What is it that you want to do exactly? The cast that you use in the DataRowsChanged event does not work, because the sender is the gird itself, not a DataRow.
If what you want is to get the new value in a specific row right after it is entered, then use the EditEnded event on the row (or the EditLeft event on the cell to get the specific cell).
e.g.:
//at Form_Load
<i>
private void Form1_Load(object sender, System.EventArgs e)
{
dataRowTemplate1.EditEnded += new EventHandler(dataRowTemplate1_EditEnded);
//or
foreach( DataCell cell in dataRowTemplate1.Cells )
{
cell.EditLeft += new EditLeftEventHandler(cell_EditLeft);
}
}
</i>
//Event handlers
<i>
private void dataRowTemplate1_EditEnded(object sender, EventArgs e)
{
System.Diagnostics.Debug.WriteLine( ( ( Xceed.Grid.DataRow )sender).Cells[ 0 ].Value.ToString() );
}
//or
private void cell_EditLeft(object sender, EditLeftEventArgs e)
{
System.Diagnostics.Debug.WriteLine( ( ( Xceed.Grid.DataCell )sender).Value.ToString() );
}
</i>
Imported from legacy forums. Posted by André (had 2954 views)