I am doing silverlight 4 app.
I have DevExpress GridControl with 4 columns. I have placed HyperlinkButton as display template for one of columns as it shown below. The item source of the gridcontrol has bound in code-behind.
<dxg:GridControl Name="grid" Height="294" Width="634">
<dxg:GridControl.Columns>
<dxg:GridColumn FieldName="Name" />
<dxg:GridColumn FieldName="Id_no" />
<dxg:GridColumn FieldName="Type" />
<dxg:GridColumn Header="View Details">
<dxg:GridColumn.DisplayTemplate>
<ControlTemplate>
<HyperlinkButton Click="HyperlinkButton_Click"/>
</ControlTemplate>
</dxg:GridColumn.DisplayTemplate>
</dxg:GridColumn>
</dxg:GridControl.Columns>
Within the HyperlinkButton’s Click eventhandler I want to open a child window and pass details(Name,Id_no,Type) of that particular row to it.
void HyperlinkButton_Click(object sender, RoutedEventArgs e) {
Childwin win_ch = new Childwin();
win_ch.Show();
// pass the row values to the child window???
}
Don’t know how get row values of the gridcontrol.
Any ideas? Is there a better method?
You can get row handle of a grid’s row that contains the hyperlink via the DataViewBase.GetRowHandleByTreeElement method. Then use the GridControl.GetRow method to obtain the row object.
Please also review the following help articles: