A
Aaron Smith
I have a question. When using a DataGrid, I want to make sure the
datasource gets updated every time the user makes changes and navigated
to a new row.
The way I am doing it now, is I have a PositionChanged event on the
BindingContext. When it changes I call a save routine. The save routine
checks to see if the first column in the datagrid is empty (primary key)
and if it is, cancels the current edit and saves a variable to notify
the save routine to start a new edit when done. It then updates the
datasource and before it finishes checks that variable to see if a new
edit needs to be started for the new row and then initiates a AddNew...
This seems like a bandaid rather than a proper way of doing it.. At
least to me right now.. Is this the proper way or is there a better way
to handle this? I was going to try to use the rowchanged event, but I
couldn't call the save routine in my form...
Thanks,
Aaron
datasource gets updated every time the user makes changes and navigated
to a new row.
The way I am doing it now, is I have a PositionChanged event on the
BindingContext. When it changes I call a save routine. The save routine
checks to see if the first column in the datagrid is empty (primary key)
and if it is, cancels the current edit and saves a variable to notify
the save routine to start a new edit when done. It then updates the
datasource and before it finishes checks that variable to see if a new
edit needs to be started for the new row and then initiates a AddNew...
This seems like a bandaid rather than a proper way of doing it.. At
least to me right now.. Is this the proper way or is there a better way
to handle this? I was going to try to use the rowchanged event, but I
couldn't call the save routine in my form...
Thanks,
Aaron