Basically I am populating a gridview from a sql table. But the problem is that this data in a particular column, needs to sometimes be displayed as a dropdownlist, sometimes a textbox.
e.g. ColA data will always be in Label format. But ColB can be dropdown list or textbox.
ColA | ColB
-----------------
label | ddlist
label | textbox
label | ddlist
How can I dynamically set the type for each ColB row??
I thought maybe it could be done using OnRowDatabound, but cant seem to find a way? Is this possible?
Try this: Use TemplateField for ColB and put both TextBox and DropdownList
In the databound of your gridview do this