Wpf 在Datagrid中编辑文本框后按enter键时,应选中复选框
我有一个带有复选框和一行文本框的datagrid。 当修改并按下“值为”文本框时,应根据是否修改值来选中复选框。 请告诉我怎么做? 我没有代码隐藏文件Wpf 在Datagrid中编辑文本框后按enter键时,应选中复选框,wpf,mvvm,datagrid,checkbox,Wpf,Mvvm,Datagrid,Checkbox,我有一个带有复选框和一行文本框的datagrid。 当修改并按下“值为”文本框时,应根据是否修改值来选中复选框。 请告诉我怎么做? 我没有代码隐藏文件 <DataGrid...ItemsSource={Binding ViewModel.YourRowItems ...some column <TextBox Text="{Binding SomeText}"... ....some column <CheckBox IsChecked="{Bindin
<DataGrid...ItemsSource={Binding ViewModel.YourRowItems
...some column
<TextBox Text="{Binding SomeText}"...
....some column
<CheckBox IsChecked="{Binding IsChecked="{Binding IsSomeProp}"..
…总之,这就是要点
public string SomeText
{
get {return _someText;}
set
{
if (_someText != value ..
{
_someText = value;
if(value != _originalSomeText)
IsSomeProp = true;//this of course will raise prop changed for IsSomeProp
RaisePropertyChanged( ()=> SomeText);
}
}