Hi,
I was using DataGrid in my project, recently which has been replaced with syncfusion grid. There was a checkbox column inside DataGrid which I was using to bind the IsChecked property.
And on the check/uncheck of checkbox, a button (outside the grid) gets enabled/disabled.
I have used below code to accomplish the task:
<syncfusion:GridDataVisibleColumn MappingName="IsChecked">
<syncfusion:GridDataVisibleColumn.CellItemTemplate>
<DataTemplate>
<CheckBox
syncfusion:VisualContainer.WantsMouseInput="true"
VerticalContentAlignment="Center">
<CheckBox.Content>
<Binding Path="CellBoundValue"
Mode="TwoWay"
UpdateSourceTrigger="PropertyChanged">
</Binding>
</CheckBox.Content>
</CheckBox>
</DataTemplate>
</syncfusion:GridDataVisibleColumn.CellItemTemplate>
</syncfusion:GridDataVisibleColumn>
And here is the code which I was using in DataGrid to achieve the same functioanlity:
<DataGridCheckBoxColumn Binding="{Binding IsChecked, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}"/>
Please help me to get out of this problem. Do reply my ASAP.
Thanks,
Sunil Goel
Hi Sunil,
Thanks for you update.
You can achieve your
requirement by using the below two ways.
Way 1: Using CheckBox CellType
You can use our inbuilt
CheckBox cell type to achieve your requirement and the following is the XAML
snippet to use the inbuilt Check Box cellType.
Code Snippet [XAML]
<syncfusion:GridDataVisibleColumn MappingName="IsChecked"> |
Way 2: Using Data Template CellType
You can also use Data
Template cell type to achieve your requirement and the following is the XAML
snippet to use the Data Template Cell Type.
Code Snippet [XAML]
<syncfusion:GridDataVisibleColumn MappingName="IsChecked"> |
Please let us know if you
have any queries.
Regards,
Kannan. S