update gridview

A

aarif.shah

Hi, i am Aarif,

I Have a gridview.On clicking the edit link of gridview i want my
edititem template(that i have defined ) to show either Texbox control
or dropdown list depending on some condition.
when user clicks on update link of the gridview,the value shoud be
taken from either textbox or selected value of dropdown list
depending upon which control is appearing in the edit mode.

How can i do this?

Aarif Majid
 
R

Riki

I suggest putting both the TextBox and the DropDownlist on the edit
template.
Depending on the condition, give the right one the property Visible=False.
You can even do this through databinding:
Visible='<%# Eval("somefield") %>'

On update, check which one is visible, and retrieve its value.
 

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

Top