I am using Rad WPF grid.
I have a requirement of opening up a new screen(edit screen) on double clicking on grid row. I also have a checkbox column and Edit button on my screen. Another requirement is when I tick checkbox grid column and click on Edit button should open a new screen(edit screen).
Please guide. Also kindly let me know whether these two functioalities can be achieved at a time
8 Answers, 1 is accepted
If you want to open a new window on double clicking on the row, you may handle the RowActivated event of the grid. Furthermore, you may take a look at this forum thread for additional reference.
As for the second requirement, my suggestion would be to expose a new boolean property in your business object and set it in the DataMemberBinding of that column. Thus when pressing the "Edit" button, you may verify whether this property is true and open the edit window.
Maya
the Telerik team

You may subscribe to the event as follows:
XAML:
<
telerik:RadGridView
Name
=
"playersGrid"
RowActivated
=
"playersGrid_RowActivated"
ItemsSource
=
"{Binding Players}"
AutoGenerateColumns
=
"False"
>
C#
:
private void playersGrid_RowActivated(object sender, Telerik.Windows.Controls.GridView.RowEventArgs e)
{
}
The event will be fired on double-clicking on the row or on pressing Enter. Do you experience any troubles with handling it ?
Maya
the Telerik team


Firstly, please take another look at the forum thread suggested above - it demonstrates how you may use an attached behavior so that you do not need to write any code in code-behind. You may use the sample attached at the last reply in the thread.
Furthermore, you may try the following:
<
swi:EventTrigger
EventName
=
"RowActivated"
>
<
swi:InvokeCommandAction
Command
=
"{Binding MyCommand, Source={StaticResource MyViewModel}}"
CommandParameter
=
"{Binding ElementName=clubsGrid}"
/>
</
swi:EventTrigger
>
</
swi:Interaction.Triggers
>
Another possibility might be to do like:
<
i:Interaction.Triggers
>
<
i:EventTriggerEventName
=
"RowActivated"
>
<
cmd:EventToCommandCommand
=
"{Binding Path=MyCommand, Source={StaticResource MyViewModel}"
PassEventArgsToCommand
=
"True"
/>
</
i:EventTrigger
>
</
i:Interaction.Triggers
>
All the best,
Maya
the Telerik team

