Hi,
I have a datagrid which has an "Actions" column containing two actions(Edit and Delete) bound to radbuttons. I'm wondering how to get the row data when I click either of these 2 buttons.
XAML:
<telerikGrid:DataGridTemplateColumn HeaderText="Actions">
<telerikGrid:DataGridTemplateColumn.CellContentTemplate>
<DataTemplate>
<StackLayout>
<Grid BackgroundColor="Transparent">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<telerikInput:RadButton
Grid.Row="0" Grid.Column="0" HeightRequest="40" Text="Edit" Margin="0, 2, 0, 0"
VerticalOptions="StartAndExpand" HorizontalOptions="Center"
BackgroundColor="CornflowerBlue" TextColor="White" Clicked="editRow"/>
<telerikInput:RadButton
Grid.Row="0" Grid.Column="1" HeightRequest="40" Text="Delete" Margin="0, 2, 0, 0"
VerticalOptions="StartAndExpand" HorizontalOptions="Center"
BackgroundColor="Red" TextColor="White" Clicked="deleteRow"/>
</Grid>
</StackLayout>
</DataTemplate>
</telerikGrid:DataGridTemplateColumn.CellContentTemplate>
</telerikGrid:DataGridTemplateColumn>
C#
private void editRow(object sender, EventArgs e)
{
//implementing logic based on which row's button is clicked
}
private void deleteRow(object sender, EventArgs e)
{
//implementing logic based on which row's button is clicked
}