复选框绑定到wpf(mvvm)中的datagrid

时间:2021-09-22 09:46:22

I am binding my data grid with a list of check boxes (WPF MVVM pattern). In the UI, I am getting a check box list with an extra empty check box row. And every time when I am checking that row and going back to any of the above options, automatically one more row is getting added.

我正在使用复选框列表(WPF MVVM模式)绑定我的数据网格。在UI中,我收到一个带有额外空复选框行的复选框列表。每次当我检查该行并返回上述任何选项时,会自动再添加一行。

I am attaching my code here.

我在这里附上我的代码。

Home.xaml HomeViewModel.cs

Home.xaml HomeViewModel.cs

复选框绑定到wpf(mvvm)中的datagrid

1 个解决方案

#1


0  

Do this. It will solve your problem.

做这个。它会解决你的问题。

<DataGrid Name="UrGrid"
CanUserAddRows="False"
... >

#1


0  

Do this. It will solve your problem.

做这个。它会解决你的问题。

<DataGrid Name="UrGrid"
CanUserAddRows="False"
... >