Quantcast
Channel: Windows Forms Data Controls and Databinding forum
Viewing all articles
Browse latest Browse all 2535

WPF DATAGRIDTEMPLATECOLUMN CHECKBOX BINDING ISSUE

$
0
0

Hi All,

I have a WPF Datagrid in my view bound to ObservableCollection(say MergeEntityColl)  present in my viewmodel. This datagrid also has one checkbox column as DataGridTemplateColumn(needed for my req.uirement)  with below XAML:

<DataGrid ItemsSource="{Binding MergeEntityColl}" AutoGenerateColumns="False" CanUserAddRows="False" x:Name="TransTypesGrid"><DataGrid.Columns><DataGridTemplateColumn><DataGridTemplateColumn.CellTemplate><DataTemplate><StackPanel><CheckBox IsChecked="{Binding IsSelected, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/>
.......................................................................................</StackPanel></DataTemplate></DataGridTemplateColumn.CellTemplate></DataGridTemplateColumn><DataGridTextColumn Header="TestHeader" Binding="{Binding Test11}" /></DataGrid.Columns>

As shown above Checkbox.Ischecked bound to IsSelected property of ObservableCollection "MergeEntityColl". In my view I have one button to select/check all the checkboxes present for records present in datagrid and one another button to deselect/uncheck all the checboxes.

Now on "Select All" command, I loop through this MergeEntityColl and assign IsSelected property  = True but this is not getting reflected in view. The Checkboxes are not getting checked/selected. Similar thing happens with deselect/uncheck all command.

Please help me in achieving above functionality. Thanks in advance.

Regards,

Pratham  


Viewing all articles
Browse latest Browse all 2535

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>