Well, following is the code for creating a custom column with button or what ever is required in a datagrid
<sdk:DataGrid AutoGenerateColumns="False">
<sdk:DataGrid.Columns>
<sdk:DataGridTemplateColumn CanUserReorder="True" CanUserResize="True" CanUserSort="True" Header="Show Details" IsReadOnly="True" Width="100">
<sdk:DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<StackPanel>
<Button x:Name="ShowContact" Content="Show" Click="ShowContact_Click" Tag="{Binding ContactID}"/>
</StackPanel>
</DataTemplate>
</sdk:DataGridTemplateColumn.CellTemplate>
</sdk:DataGridTemplateColumn>
</sdk:DataGrid.Columns>
</sdk:DataGrid>
Certain names and bindings are used a example only.
No comments:
Post a Comment