xml:Button in my datagrid
<DataGridTemplateColumn Header="Update">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<Button Content="Update" Name="btnEmpGridUpdate" Tag="{Binding Path = EMPID}" Click="btnEmpGridUpdate_Click" ></Button>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
code in button event :
Object Id = new Object();
Id = ((Button)sender).Tag;
Is that a possible way to retrieve all cell’s value of a selected row ? If , how can I do this ? Or else , please suggest me some other way to update in my dataset from datagrid. Thanks in advance . 🙂
Use these helper functions;
http://techiethings.blogspot.com/2010/05/get-wpf-datagrid-row-and-cell.html
On your Update button, hook up Click event, and in the handler, do something like this:
I didn’t completely understand what you wanted to do, but this should help.