Search code examples
c#winformsxtragriddevexpress-windows-ui

e.value is null on CellValueChanged event on specific column in DevExpress XtraGrid c#


I am updating the Cellvalue of grid in Winforms on CellValueChanged event and it is working very fine for my hundreds of grids but getting null value for the specific column. Below is my code

private void gvResults_CellValueChanged(object sender, DevExpress.XtraGrid.Views.Base.CellValueChangedEventArgs e)
{
    string t = e.Value.ToString();
    string low = null;
    low = gridView.GetFocusedRowCellValue(gvResults.Columns["ColumnName"]).ToString();
}

I have checked the following measurements after googling 1. FieldName Uniqueness

Please suggest a solution and correct me if i am doing something wrong.

Thanks in advance


Solution

  • Got the solution finally and it is If you bound the column with the grid then you need to add that column in the Datatable as well which you're assigning as DataSource to the Grid.