Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
100
Checked only specific checkbox
posted

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");
}
}

Parents
  • 6365
    Offline posted

    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.

    XamDataGrid_CheckSpecificRecord.zip
Reply Children