0
votes

I'm using C#, Windows Forms, DevExpress 19.1. I have a grid whose data source is a binding list. I've allowed the option for the user to enter a new row of data. After the user enters the new data, how do I get the new data? For updates, I've used the CellValueChanged or RowUpdated events which give me a row handle and then I use that row handle to get he new values. But when I do this on an added row, the row handle is -2147483647.

An example. Below is my grid. I just typed in the values in the bottom highlighted row. How to I get the values for this row in the code?

enter image description here

1
Hi are you using INotifypropertychanged ? if yes your list (datasource) will be updated when value are changed or new valueZz Oussama

1 Answers

0
votes

Based on ZZ Oussama's comment above, I used the Dev Express link he suggested to come up with this solution using the RowUpdated event:

private void gvCompanies_RowUpdated(object sender, DevExpress.XtraGrid.Views.Base.RowObjectEventArgs e)
{
    Department newCompany = (Department)e.Row;
}