开发者

WPF DataGridTextColumn UpdateSourceTrigger=PropertyChanged does not work

I know this is a known problem. What I want is that the data source is updated as the user types. You can do this with a DataGridTemplateColumn which wraps around a TextBox, but this results in a performance hit, DataGridTextColumn is a lot more efficient.

I have already extended Dat开发者_StackOverflowaGridTextColumn but there are no events I can use to get the functionality I desire.

Is there anything I can do?

Kind regards, Fugu

edit: As requested here is a XAML snippet:

Here is the DataGrid:

<UserControls:CommandDataGrid Name="dgCLASS_MN" 
Command="{x:Static my2:Commands.ClassVRPopulateCommand}"
AutoGenerateColumns="false"
DataContext="{StaticResource ResourceKey=ClassViewModel}"
ItemsSource="{Binding Path=MainTableView}"
SelectedItem="{Binding Path=MainTableSelectedRow}"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
ClipToBounds="True"
SelectedCellsChanged="SelectedCellsChanged">

And here is one of the columns.

<UserControls:FreezableDataGridTextColumn Header="BASE_LANGUAGE_NAME" 
    SortMemberPath="BASE_LANGUAGE_NAME" Binding="{Binding Path=BASE_LANGUAGE_NAME, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/>

FreezableDataGridTextColumn descends from DataGridTextColumn which poses the same problem.

The DataGrid is bound to a DataTableView in the code behind.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜