I want to check the specific checkbox on xamdatagrid only. When i click on the specific row, only the checkbox on that row is checked. How can i achieve this?
======XAML======
<Grid.Resources> <Style x:Key="CheckboxStyle" TargetType="{x:Type igDP:CellValuePresenter}"> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type igDP:CellValuePresenter}"> <!--<CheckBox IsEnabled="True" Content="{Binding IsCheckedBoolean}" IsChecked="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Value, Mode=TwoWay}" Command="{Binding BooleanType}" CommandParameter="{Binding IsCheckedBoolean, RelativeSource={RelativeSource Self}, UpdateSourceTrigger=PropertyChanged}" />--> <CheckBox IsChecked="{Binding DataContext.IsCheckedBoolean, RelativeSource={RelativeSource AncestorType={x:Type igDP:XamDataGrid}}}" /> </ControlTemplate> </Setter.Value> </Setter> </Style> </Grid.Resources>
<igDP:UnboundField Label="Action" Width="auto"> <igDP:UnboundField.Settings> <igDP:FieldSettings CellValuePresenterStyle="{StaticResource CheckboxStyle}" /> </igDP:UnboundField.Settings> </igDP:UnboundField>
=======View Model======
public Boolean IsCheckedBoolean { get { return _isChecked; } set { _isChecked = value; RaisePropertyChanged("IsCheckedBoolean"); } }
Hello Donna,
Thank you for choosing Infragistics.
I have been looking into your issue and I believe I have come up with a solution that will help you achieve the functionality you are looking for. I have prepared a sample application for you to test and see if the desired effect is achieved.
In the XamDataGrid’s Resources I have defined a custom Style representing a CheckBox for the UnboundField in the grid. The IsChecked property of the CheckBox is bound to the IsSelected property of the DataRecord. In the XamDataGrid’s FieldSettings I have set the value of the CellClickAction property to SelectRecord. When the CellClickAction property is set to SelectRecord you have to double click the cell in order for it to go into edit mode. Whenever a cell is clicked, it’s corresponding Record will be selected.
If you need any further assistance on this matter, please do not hesitate to ask.
Thanks Tacho for your fast respond. However what I want to achieve is when user clicks on the checkbox, the checked row data will put into another XamDataGrid that shows on the same page. Then the checkbox on the first XamDatGrid will be disabled. Do you have any idea?