dynamically edit ItemTemplate

Discussion in 'ASP .Net' started by Guest, Aug 8, 2005.

  1. Guest

    Guest 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?
     
    Guest, Aug 8, 2005
    #1
    1. Advertisements

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 (here). After that, you can post your question and our members will help you out.