WPF -MVVM : Checkbox Check Change in RadGridView

4 posts, 0 answers
  1. crazy05
    crazy05 avatar
    72 posts
    Member since:
    Sep 2014

    Posted 07 Jul 2015 Link to this post

    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>  

  2. Yoan
    Admin
    Yoan avatar
    1068 posts

    Posted 08 Jul 2015 Link to this post

    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
  3. UI for WPF is Visual Studio 2017 Ready
  4. crazy05
    crazy05 avatar
    72 posts
    Member since:
    Sep 2014

    Posted 08 Jul 2015 Link to this post

    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

  5. Dimitrina
    Admin
    Dimitrina avatar
    3769 posts

    Posted 13 Jul 2015 Link to this post

    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
Back to Top