User (Old forums)MemberApril 30, 2007 at 2:25 pmPost count: 23064
Is there a way to force the DataGridControl to update its ItemsSource. At the moment it only seems to update the source when the user moves off a row or presses Enter to commit the changes. I’m referring to updating the bound DataTable not the backend database.
The following command looked promising but didn’t have any effect:-
I need a way to force RowValidation and commit changes when the user presses the Save button even if they haven’t moved out of a changed cell.
Imported from legacy forums. Posted by Michael (had 4619 views)Xceed SupportMemberMay 7, 2007 at 8:56 amPost count: 5658
What you could do is to explicitly call EndEdit() on the currently edited row before processing the “Save” button logic.
You can do so the following way:
Row myRow = myDataGridControl.ItemContainerGenerator.ContainerForItem( myDataGridControl.CurrentItem ) as Row;
if( myRow != null)
Note: the EndEdit() function will throw a DataGridValidationException() if RowValidation fails.
Imported from legacy forums. Posted by Marcus [Xceed] (had 538 views)User (Old forums)MemberMay 7, 2007 at 2:05 pmPost count: 23064
Thanks Marcus, that worked.
Any reason why DataGridCommands.EndEdit.Execute didn’t work?
Imported from legacy forums. Posted by Michael (had 462 views)Xceed SupportMemberMay 7, 2007 at 3:19 pmPost count: 5658
Long story short: Only Rows are handling the [Begin\End\Cancel]Edit commands…
However, we are planning to extend that feature to include the DataGridControl as well (post 1.1, exact timeframe not determined yet ).
Imported from legacy forums. Posted by Marcus [Xceed] (had 330 views)User (Old forums)MemberMay 8, 2007 at 7:58 amPost count: 23064
Well, yesterday it worked and today it doesn’t work! I guess Windows is like that. 🙂
Today myDataGrid.CurrentItem is always null (also SelectedItem). Completely baffled! Any idea what might cause this?
Also, will the ‘Search this forum’ be fixed soon. I’d like to be able to do a search before posting questions.
Imported from legacy forums. Posted by Michael (had 447 views)Xceed SupportMemberMay 8, 2007 at 8:38 amPost count: 5658
Hmmm, you would have to provide me with some more details on the CurrentItem and SelectedItem problem… (DataGridControl initialization code, exact steps to reproduce, …).
Concerning the “Search this forum”… It’s been bothering us as well, and we are in the process of changing the “community” site…
In the mean time, I can give you a workaround to using the “Search” textbox directly from the forum… Instead, go in the “Xceed Discussion Forums” root. From that page, if you use the search option… its gonna work… ( you’ll be brought to a page where it is possible to put filters on the search)
Imported from legacy forums. Posted by Marcus [Xceed] (had 265 views)User (Old forums)MemberMay 8, 2007 at 2:22 pmPost count: 23064
Figured it out.
All is fine for existing rows (CurrentItem != null) but not for new rows. It seems CurrentItem and SelectedItem aren’t being set for new rows.
…Ah, come to think of it maybe that’s because its an InsertionRow and not yet part of the DataGrid Items collection. Just a minute and I’ll try that…
Some time later…
Phew. That was it but finding the InsertionRow isn’t easy. In the end I defined a CustomInsertionRow and set a static Current property on it. How can I find the InsertionRow given a DataGridControl instance?
Is there a reason for not setting CurrentItem and SelectedItem when editing in the InsertionRow?
Presumably there should only ever be one InsertionRow per grid so can we have a property on the DataGridControl to make it easier to find?
Imported from legacy forums. Posted by Michael (had 5770 views)
- You must be logged in to reply to this topic.