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

Using Commands on Button in Grid Row

4 Answers 224 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Laura Edwards
Top achievements
Rank 1
Laura Edwards asked on 13 Aug 2010, 03:25 PM
I am having an issue where I can not use a command from my view model on a button that is embedded in a grid row. I want to be able to call this command and pass the selected row as the parameter in order to do service calls on the row object selected.

When I attach the command to the button in the row, nothing happens. When I take the button out of the grid row, the command works just fine.

Is this a glitch or can you not call a command on a button in a grid row?

4 Answers, 1 is accepted

Sort by
0
Maya
Telerik team
answered on 13 Aug 2010, 03:48 PM
Hello Laura Edwards,

I am sending you a sample project illustrating how to perform a command  that is defined for a button in a row. In this case the command is "Delete" and it removes the item on the same row as the button.
In case that does not meet your exact requirement, we would need more details about your scenario in order to provide you with a more accurate solution.
 

Regards,
Maya
the Telerik team
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 Public Issue Tracking system and vote to affect the priority of the items
0
Laura Edwards
Top achievements
Rank 1
answered on 13 Aug 2010, 04:09 PM
It gives me this error:
Error 3 The property 'AncestorType' does not exist on the type 'RelativeSource' in the XML namespace 'http://schemas.microsoft.com/winfx/2006/xaml/presentation'. 
0
Accepted
Maya
Telerik team
answered on 16 Aug 2010, 08:27 AM
Hello Laura Edwards,

Please excuse me for the misunderstanding. I am sending you a new - more appropriate for your scenario- project.
 

Best wishes,
Maya
the Telerik team
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 Public Issue Tracking system and vote to affect the priority of the items
0
Laura Edwards
Top achievements
Rank 1
answered on 16 Aug 2010, 02:03 PM
Thank you. This is exactly what I needed.
Tags
GridView
Asked by
Laura Edwards
Top achievements
Rank 1
Answers by
Maya
Telerik team
Laura Edwards
Top achievements
Rank 1
Share this question
or