dynamically edit ItemTemplate

G

Guest

Hi,

I have a datagrid with 2 template columns. One of the columns has a
EditItemTemplate defined that is just a textbox say called edClass. When the
user edits the row of the datagrid I want to check the value in another
column first and depending on its result I want to either allow a column to
be edited or not by somehow not showing its EditItemTemplate. i.e. sometimes
I want to allow the edClass textbox to be visible and other times the
itemtemplate just remain when the user is editing the row. Does this make
sense?

I can get the value I want to check by doing this....
If CType(e.Item.FindControl("lblPendingRestype"), Label).Text() = "ClassA"
Then
Dont allow the user to edit, dont display the edClass textbox
that is defined in the edititemtemplate
End If

How can I do this?
 

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

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,023
Latest member
websitedesig25

Latest Threads

Top