i have 2 text box ,1 button and data grid .
i want to add textbox's values to datagrid on button click
plz help me
Here are 2 different ways to accomplish this.
1. You can create an arraylist and add the text from each textbox to the arraylist. Then assign the datasource of your datagrid to the arraylist. Then call DataBind().
2. You could use 2 Template Columns in your datagrid. Add a label control in each Template column and set the text of each label = to the text of textbox1 and textbox2.
Try either one and let me know if you run into any problems.
can u give me c# code for it i am not able to add it to grid using arraylist
If the arraylist doesn't work for you. Then you could add the text from the textboxes to a datatable, a dataset, an array. There are many data containers you can use as a datasource.
Comment