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

Raising Checkbox checked event in GridViewCheckBoxColumn in MVVM

1 Answer 325 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Sirisha Peyyeti
Top achievements
Rank 1
Sirisha Peyyeti asked on 12 May 2011, 04:12 PM
Hi,

I have GridViewCheckBoxColumn ,and have cellEdit template with CheckBox .Code contains some thing like this,but events are not raising view model
<CheckBox>

<

 

 

i:EventTrigger EventName="Checked">
<ei:CallMethodAction MethodName="OnDemandClientEnabled_Checked" TargetObject="{Binding}"/>

 

 

 

</i:EventTrigger>

<i:EventTrigger EventName="Unchecked">  

 

<ei:CallMethodAction MethodName="OnDemandClientEnabled_UnChecked" TargetObject="{Binding}"/> 

 

 

 

</i:EventTrigger>

</i:Interaction.Triggers>
</CheckBox>

Please give solution on this.

Thanks,
Sirisha.

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 13 May 2011, 05:49 AM
Hello Sirisha,

One option is attach 'SelectionChanged' event to RadGridView which will fire when selecting CheckBox in 'GridViewCheckBoxColumn'.

<telerik:RadGridView  ItemsSource="{Binding ItemCollection, Mode=TwoWay}" SelectionMode="Extended" Name="GridView1" AutoGenerateColumns="True">
      <interactivity:Interaction.Triggers>
            <interactivity:EventTrigger EventName="SelectionChanged">
                 <cmd:EventToCommand PassEventArgsToCommand="True" Command="{Binding SelectionChangedCommand,Mode=TwoWay}" CommandParameter="{Binding SelectedItems,ElementName=GridView1}"  />
            </interactivity:EventTrigger>
     </interactivity:Interaction.Triggers>
               <telerik:RadGridView.Columns>
                   <telerik:GridViewCheckBoxColumn></telerik:GridViewCheckBoxColumn>
               </telerik:RadGridView.Columns>
</telerik:RadGridView>

-Shinu.
Tags
GridView
Asked by
Sirisha Peyyeti
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or