Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
430
Problem with Refreshing a grid
posted

Hello
I Have a problem with refreshing winGrid.
I bind data to the grid like this:
            private BindingSource bs;
            var employeeQuery = from employee in db.Employees
                                orderby employee.LastName
                                select employee;
            bs = new BindingSource(employeeQuery, "");
            ultraGrid1.DataSource = bs;

The grid display all the data.
When I change a value in a cell, and I want to refresh the grid so I will see the original data, the drid do not refresh itself, and I stiil see the new data i wrote.
To refresh the grid I used: ultraGrid1.Rows.Refresh(Infragistics.Win.UltraWinGrid.RefreshRow.ReloadData);
Thanks,
Yossy

 

 

Parents
No Data
Reply
  • 469350
    Verified Answer
    Offline posted

    Hi Yossy,

    When you make a change to a grid cell and then leave the cell, the data is saved to the grid's DataSource. So calling Refresh will not do anything. The grid will reload the data from the data source, but that has already been updated. 

    If the row is still in edit mode, and the user has not yet left the row, you might be able to get what you want by calling grid.ActiveRow.CancelUpdate. 

    If that doesn't work, then you will need to rely on your data source to undo the changes. I'm not sure if a LINQ datatable will do that. 

     

Children