Click here to Skip to main content
15,040,212 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
I want to adding dynamic row in 'GridView' with 'DropDownList' & 'TextBox'.
And bind Data to 'DropDownList' from Table. And it happen when i click on 'LinkButton'
Please reply.
Posted

OK, what have you tried ? What do you mean 'it happen when I click on linkbutton' ? You can define a column to contain a drop down list, and then define a data source for that drop list. You can also use the data bound event to find the control, bind it, and set it's initial value. Tons of examples exist on the web.
   
Hi

You can make user control for that. and call that user control at button click event.
   
If i am getting you right, you want to add a row to the gridview with two columns - one containing dropdownlist (bound to some data source) and another textbox.

gridview doesn't support insertion. But there is a workaround - use footer template to do so. You can add dropdownlist and textbox control in the footer template column. you can access both dropdownlist and textbox by their Id's. On LinkButton click u can set gridview.FooterRow.visible property to true. Let me know if you have any issues.

Hope it helps...
   

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