For exactly this reason, you shouldn't really bind directly against your domain entities; you should project those entities into DTOs and/ or ViewModel's and bind against those instead.
On Aug 24, 3:57 am, litgle <[email protected]> wrote: > Now, i post fails code again: > > I have some DataGrid like this: > <DataGrid Name="dgList" AutoGenerateColumns="False" > IsReadOnly="True" CanUserAddRows="True" ItemsSource="{Binding}"> > <DataGrid.Columns> > <DataGridTextColumn Header="NO." Binding="{Binding > Path=NO}"/> > <DataGridTextColumn Header="Name" Binding="{Binding > Path=Name}"/> > <DataGridTextColumn Header="Description" Binding="{Binding > Path=Description}"/> > <DataGridCheckBoxColumn Header="Enable" Binding="{Binding > Path=En}"/> > </DataGrid.Columns> > </DataGrid> > > Then, i Get a Level Collection and Binding to dgList > List<Level> ldl; > ldl = GetList(); > > Binding bind = new Binding(); > bind.Source = ldl; > bind.Path = new PropertyPath("."); > bind.Mode = BindingMode.OneWay; > > dgList.SetBinding(DataGrid.ItemsSourceProperty, bind); > > When i edit the Level instance on other page as follows > EditPage ep = new EditPage(dgList.SelectedItem as Level); > ep.Show(); > > If the instance of Level's Type in collection isn't > "Domain.Level"(it's like > "LevelProxyfbd6621e466a4c7f8e9623ee071237b4"), it cann't synchronous > display on dgList after edit in ep. > > Example: the Name of first row in dgList is "MyName", and the type of > first row is "LevelProxyfbd6621e466a4c7f8e9623ee071237b4", then i edit > Name to "MyName is Test" in ep, it's display "MyName" yet in first row > in dgList, but the Name of dgList.Items[0] is "MyName is Test" > already. > > Regards, > litgle -- You received this message because you are subscribed to the Google Groups "nhusers" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/nhusers?hl=en.
