Hi veerabramhendra,
We need to create our own DataGridColumnStyle to handle the button column. The article below shows how to create a DataGridButtonColumn:
http://msdn.microsoft.com/en-us/library/ms996453.aspx#datagridcolumnstyle2_topic8.
You can download the source code from:
http://download.microsoft.com/download/5/9/f/59fb923a-12a2-4c3a-952d-d0ccccc7bf15/StylingWithTheDataGridColumnStylePart2.msi.
We cannot directly delete a specific row in the DataGrid, but we can do that via the CurrencyManager or data source. This is a code snippet:
//Method1: Remove current row via CurrencyManager.
CurrencyManager currencyManager = this.BindingContext[this.dataGrid.DataSource] as CurrencyManager;
currencyManager.RemoveAt(this.dataGrid.CurrentRowIndex);
//Method2: Remove current row via underlying DataTable.
DataTable dt = this.dataGrid.DataSource as DataTable;
dt.Rows.RemoveAt(this.dataGrid.CurrentRowIndex);
Let me know if this does not help.
Aland Li
Please mark the replies as answers if they help and unmark if they don't. This can be beneficial to other community members reading the thread.