Click here to Skip to main content
15,896,063 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi All

I want to add dynamically row in Datagrid , having controls like TextBox, ComboBox etc. in silverlight,
when user click on new button.

Thanks and Regards
Anurag
Posted

1 solution

You can have a class which holds the value of the controls whatever you want and maintain a global collection of that class...
ObservableCollection<employee> obj = new ObservableCollection<employee>()
where Employee is your defined class.

Now on button click , you can add the new row like this
C#
Private void AddRows(sender,args){
obj.Add(new Employee() {.... });
 datagrid1.itemsource=obj;
 }
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900