Hi,
I have a DataGrid containing a Button as follows:
<dg:DataGrid ItemsSource="{Binding Items}" SelectionEnabled="True" SelectedItem="{Binding SelectedItem}"> <dg:DataGrid.Columns> <dg:DataGridColumn Title="Edit" PropertyName="Streak" Width="0.3*"> <dg:DataGridColumn.CellTemplate> <DataTemplate> <StackLayout> <Button Text="Edit" Clicked="Edit_Button_Clicked" WidthRequest="200" /> <Button Text="Delete" Clicked="Delete_Button_Clicked" WidthRequest="200" /> </StackLayout> </DataTemplate> </dg:DataGridColumn.CellTemplate> </dg:DataGridColumn> </dg:DataGrid.Columns> </dg:DataGrid ItemsSource>
As you see, I handle the button click but when hitting the button, the grid's SelectedItem is not yet set. How can I retrieve the row in which the editor was clicked (or even better, the corresponding bound item)??