Updating DataSet

Jan 21, 2009 at 8:40 AM

I'm using v1. Datagrid and have a column:

   <my:DataGridTemplateColumn Header="Home Phone">
               <local:MaskedTextBox InputMask="+7 (iii) iii-ii-ii" Text="{Binding HomePhone, Mode=TwoWay}" />
               <TextBlock Text="{Binding HomePhone}" VerticalAlignment="Center" HorizontalAlignment="Center" />

When I launch an application it work perfectly, except that I need press Enter in edit mode to commit changes in cells. How to commit them when cell or row losing focus?

I use an EF query as ItemsSource
Jan 21, 2009 at 2:08 PM
"How to commit them when cell or row losing focus?"

When the cell or row loses focus, it is not commiting?  Does pressing 'tab' work?
Jan 21, 2009 at 5:10 PM

I have just published a blog post about committing changes as the focus moves from one cell to the next:


Colin E.
http://www.scottlogic.co.uk/blog/wpf/ - my WPF blog
http://www.codeproject.com/KB/WPF/WPFDataGridExamples.aspx - WPF DataGrid Practical Examples
Jan 22, 2009 at 6:24 AM
2 vinsibal:
I have complicate query for selecting items, so I need custom logic for update. Because of that, I hook up to RowEditEnding event where I post changes to database.
If I pressed 'Enter' or 'Tab' (as you advice) then all changes in controls reflected in entity, otherwise - no.

2 ColinEber:
Thanks, nice post.