Question How to access a control in a templatefield of a gridview ?

Bauhaus

Member
Joined
May 11, 2008
Messages
12
Programming Experience
Beginner
I'm making a pizzasite and I use a gridview with the columns Pizzaname, Pizzasize and Pizzaprice via an objectdatasource. It would be nice if the user also could enter the number of a certain pizza so I created an additional column Pizzanumber with a templatefield that contains a textbox control, so the user can enter the number of a specific pizza in the textbox.
When I use the method Gridview.SelectedRow.cells() to obtain the textboxvalue of the selected row, the value is unfortunately always "nothing", it doesnt matter if I enter a value in the textbox or not.
I tried several properties of the gridview, but I dont know how to access the TextBox control in the templatefield of a column in the gridview.

Any suggestions how to solve this ?
 

Latest posts

Back
Top