Dynamic Row Template in GridView

E

Erik

Good Afternoon,
I am trying to figure out how to dynamically create a TemplateColumn based
on a record's field value. If the record has a DataType of Number or Text, I
would like a textbox to render. If the record's DataType is List, a
DropDownList would be rendered. All the examples I have been studying deal
with columns, where these controls need to be defined for each row.
Any help is greatly appreciated.
Thanks, Erik
 
E

Erik

Good Morning Phillip,
Thanks for the response. The columns for this GridView are going to always
be the same, one column for the question, one column for the response. Each
row in the GridView has to be rendered differently based on the record's
data. It looks like I can use the GridView_RowDataBound, but I am having
difficuly how to dynamically add one column for the text of the question, and
the second column for the control (either a textbox or dropdownlist) to
capture the answer.
Thanks,
Erik
 
D

Daniel

Hi guys, I'm having the same exact situation, i need to put on some rows a dropdownlist or a textbox (depending on a particular situation), please please let me know if there a way to do this.
thanks a lot!!!.
:)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,102
Messages
2,570,645
Members
47,247
Latest member
GabrieleL2

Latest Threads

Top