.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Forum >> WPF >> Post New QuestionBookmark and Share Subscribe to Forum

Add button to datagrid Dynamially in wpf

Posted By: Aamrapali Tamgadge     Posted Date: March 23, 2013    Points:5   Category :WPF
hello sir i have added the follwing colmns in datagrid but in addtion to i want to add one Remove button in my grid so that i can remove the items from datagrid.
{
InitializeComponent();
dtcol.ColumnName = "Sr No";
dt.Columns.Add(dtcol);

dtcol = new DataColumn();
dt.AcceptChanges();
dtcol.ColumnName = "Post";
dt.Columns.Add(dtcol);

dtcol = new DataColumn();
dt.AcceptChanges();
dtcol.ColumnName = "Member Type";
dt.Columns.Add(dtcol);
}

under addto list button click event
{ dr = dt.NewRow();

dr["Sr No"] = srno;
dr["Post"] = cmbpost.Text;
dr["Member Type"] = cmbmembertype.Text;

dt.Rows.Add(dr);
dataGrid1.ItemsSource = dt.DefaultView;
dataGrid1.CanUserAddRows = false;

}



my question is how can i add new remove button to datagrid so that it will appear for each row.

Responses
Author: Narayanan          Accepted Answer   
Posted Date: April 08, 2013     Points: 40   


Post Reply

You must Sign In To post reply
 
 
Find more Forum Questions on C#, ASP.Net, Vb.Net, SQL Server and more Here
Quick Links For Forum Categories:
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  OOPs  SilverlightIISJQuery
JavaScript/VBScriptBiztalkWPFPatten/PracticesWCFOthers
www.DotNetSpark.comUnAnsweredAll

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend