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
185
Win Grid Row Update Problem
posted

I am having some problems using win grid. Following is my scanrio.

I have a data gird bound with a bindingsource.

On row update, I need to fetch the row data before it was updated . I tried to catch BeforeRowUpdate(sender,e) event. It gives me new values. If I try to get value from dataset against e.Row.Index (index of row passed to BeforeRowUpdate event), it again gives me the new value entered in the gird cell.

Kindly help me out with this. I am stuck in the middle of no where because of this problem.

Thanks in advance,

Parents
No Data
Reply
  • 469350
    Verified Answer
    Offline posted

    Hi,

    The grid updates the data source based on the UpdateMode property. By default, it's set to OnCellChangeOrLostFocus. If you change this to OnRowChangeOrLostFocus, then you should be able to get the values from the underlying data source. 

    Also, it's not a good idea to use the Index of the row to get the underlying data row. The rows in the grid might be filtered or sorted and so the indices would be incorrect. What you should do is use row.ListObject to get the actual data object underlying the row. 

Children