I have a Data Form and a Grid. What I am doing is that every time we move forward or backwards in the Data Form, the Grid gets updated, sometimes by manually setting the current item in the Data Form and consequently updating the Grid based on an ID key.
Example #1:
Adding a new record to the Data Form. I use the Edit Ended event to Save the changes via EF. This works fine. After saving I am setting the Data Form current item to the newly created record. In my case, this means updating the Data Form (re-loading all values from the database), doing a look up and updating the Data Form current item and finally updating the Grid.
This is not working for me. Re-loading the Data Form works but setting the Data Form current item is not working
Example #2:
After I enter a new Data Form item, EF returns back an error on dups. (based on PK), which is perfect. Since the item exists, I want to position the Data Form on that record by manually setting the current item, but this is not working either.
When I say that it does not work, I mean that after I do the following on the EditEnded event:
this.dataForm.CurrentItem = [Do a look up based on PK and return object]
The Current Item Changed event fires (which is expected) and there I update the Grid, but at this point is where dataForm.CurrentItem is null preventing me from updating the Grid
Ideas/comments are appreciated.
Thanks, M
Example #1:
Adding a new record to the Data Form. I use the Edit Ended event to Save the changes via EF. This works fine. After saving I am setting the Data Form current item to the newly created record. In my case, this means updating the Data Form (re-loading all values from the database), doing a look up and updating the Data Form current item and finally updating the Grid.
This is not working for me. Re-loading the Data Form works but setting the Data Form current item is not working
Example #2:
After I enter a new Data Form item, EF returns back an error on dups. (based on PK), which is perfect. Since the item exists, I want to position the Data Form on that record by manually setting the current item, but this is not working either.
When I say that it does not work, I mean that after I do the following on the EditEnded event:
this.dataForm.CurrentItem = [Do a look up based on PK and return object]
The Current Item Changed event fires (which is expected) and there I update the Grid, but at this point is where dataForm.CurrentItem is null preventing me from updating the Grid
Ideas/comments are appreciated.
Thanks, M