<data:datagrid name="gridCustomers" autogeneratecolumns="False" headersvisibility="All" gridlinesvisibility="All" isreadonly="True" rowbackground="Cornsilk" alternatingrowbackground="LemonChiffon"
ColumnWidth="85" RowHeight="30" CanUserResizeColumns="False" Canvas.Top="603" Canvas.Left="16" Width="1072" Height="120" SelectionMode="Single" >
<data:datagrid.columns>
<data:datagridtextcolumn header="Id" binding="{Binding id}">
<data:datagridtextcolumn header="Location Name" binding="{Binding Name}">
<data:datagridtemplatecolumn header="Edit">
<data:datagridtemplatecolumn.celltemplate>
<datatemplate>
<button content="Edit" margin="4" tag="{Binding customlocationid}" click="datagridEditRow_Click"></button>
</datatemplate>
</data:DataGridTemplateColumn.CellTemplate>
</data:DataGridTemplateColumn>
<data:datagridtemplatecolumn header="">
<data:datagridtemplatecolumn.celltemplate>
<datatemplate>
<button content="Delete" margin="4" tag="{Binding customlocationid}" click="datagridDeleteRow_Click"></button>
</datatemplate>
</data:DataGridTemplateColumn.CellTemplate>
</data:DataGridTemplateColumn>
The above code gives the WPF markup for the grid. See the bold font for the Templated Column definitions for the "Edit" and "Delete" buttons.
No comments:
Post a Comment