I'am working with c# and WPF, i have a DataGrid control to which i display data from a DataTable dynamically and also AutoGeneratedColumns property of DataGrid control is set to false.
Now the problem is that i want to add another column (DataGridTemplateColumn) in the DataGrid control which will be the last column.
I have used code like below to add Button column:
<DataGridTemplateColumn >
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<Button Click="btnDetails">Details</Button>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
By using above code, button column is added to DataGrid but as a FIRST column and then all columns of DataTable is added after that dynamically.
So i just want to add this DataGridTemplateColumn in the last of all columns. Please Help me out with this.
Thanks.