My problem statement is to add a column in grid with button. And on click of that, I want to perform some action on that particular row. My grid name is GridIndex.
My code in View (xaml) is as below:
<telerikGrid:GridViewDataColumn Header="{Binding Source={StaticResource c}, Path=s.Action}" Width="Auto" DataMemberBinding="{Binding Action,Mode=TwoWay}" >
<telerikGrid:GridViewDataColumn.CellTemplate>
<DataTemplate>
<Button Padding="7">
<interactivity:Interaction.Triggers>
<interactivity:EventTrigger EventName="Click">
<UI:CommandAction Command="{Binding Source={StaticResource ServiceLocator}, Path=EventLogViewModel.AcknowledgeCommand}" CommandParameter="{Binding ElementName=GridIndex}"/>
</interactivity:EventTrigger>
</interactivity:Interaction.Triggers>
<StackPanel Orientation="Horizontal">
<Image Height="12" Source="/Cirrus.Core.UI.Images;component/Images/check.png" />
</StackPanel>
</Button>
</DataTemplate>
</telerikGrid:GridViewDataColumn.CellTemplate>
</telerikGrid:GridViewDataColumn >
My code in ViewModel is as below:
AcknowledgeCommand = new DelegateCommand<object>(Acknowledge, CanAcknowledge);
public void Acknowledge(object ackData)
{
.............
.............
}
Everytime, I am getting ackData as null. Kindly tell me, how can I get data into ackData
for further processing