This is a migrated thread and some comments may be shown as answers.

WPF -MVVM : Checkbox Check Change in RadGridView

3 Answers 283 Views
GridView
This is a migrated thread and some comments may be shown as answers.
crazy05
Top achievements
Rank 1
crazy05 asked on 07 Jul 2015, 01:16 PM

Here is my Checkbox in RadGridView which is not implemented in MVVM. I would like to implement this MVVM.

I used interaction triggers but the command is not getting fired. How can I do this ?

<telerik:GridViewDataColumn Header="Delete" Width="60">
        <telerik:GridViewDataColumn.CellTemplate>
            <DataTemplate>
                <CheckBox HorizontalAlignment="Center" IsChecked="{Binding IsDeleted, Mode=TwoWay}" >
                    <i:Interaction.Triggers>
                        <i:EventTrigger EventName="Checked">
                            <cmd:EventToCommand Command="{Binding DiagramChecked}" />
                        </i:EventTrigger>
                    </i:Interaction.Triggers>
                </CheckBox>
            </DataTemplate>
        </telerik:GridViewDataColumn.CellTemplate>                  
    </telerik:GridViewDataColumn>
<telerik:GridViewDataColumn Header="Delete" >
  <telerik:GridViewDataColumn.CellTemplate>
      <DataTemplate>
          <CheckBox IsChecked="{Binding IsDeleted, Mode=TwoWay }" Checked="ToggleButton_OnChecked"  Unchecked="ToggleButton_OnUnchecked">
          </CheckBox>
      </DataTemplate>
  </telerik:GridViewDataColumn.CellTemplate>
 </telerik:GridViewDataColumn>  

3 Answers, 1 is accepted

Sort by
0
Yoan
Telerik team
answered on 08 Jul 2015, 01:59 PM
Hi,

I already answered your forum thread on the subject. 

Regards,
Yoan
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
crazy05
Top achievements
Rank 1
answered on 08 Jul 2015, 02:40 PM

Hi Yoan,

 I tried your solution and unable to get the desired result. Can you help me in changing the cell color on Checkbox Check Change.

For me Checkbox click is not working in MVVM which is working in Non-MVVM model

0
Dimitrina
Telerik team
answered on 13 Jul 2015, 06:56 AM
Hi,

In order to apply conditional styling based on the bound property value changed (checked/unchecked), I would suggest you applying a CellStyleSelector. You can also check the CellStyleSelector online demo (or the same available with your local WPF Demos). 

Regards,
Dimitrina
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
GridView
Asked by
crazy05
Top achievements
Rank 1
Answers by
Yoan
Telerik team
crazy05
Top achievements
Rank 1
Dimitrina
Telerik team
Share this question
or