Hiding and Showing Columns in Editable GridView

Discussion in 'ASP .Net' started by Guest, Mar 21, 2007.

  1. Guest

    Guest Guest

    I have a gridview that is being used for managing inventory. The default
    view shows the stock currently available. When editing I don't want the
    stock to be directly edited, rather the user will enter the amount of items
    being added/removed.

    When the user clicks the 'Edit' link I want to hide the stock column and
    display a field for the TransactionAmt. I'm using the RowUpdating event to
    execute some functions used by that field. I've added the column and am
    showing/hiding using the visible property, which works fine for that, but
    when I hide the stock column I can no longer access the value that was in
    that field.

    Any suggestions?
    Guest, Mar 21, 2007
    1. Advertisements

  2. Guest

    Liming Guest

    In yoru gridview, editTemplate, simply just make the textbox disabled,
    then you shall be able to get teh value later on.

    Hope that helps.

    Liming Xu
    Jumptree Project Management
    Liming, Mar 22, 2007
    1. Advertisements

  3. Any web control with Visible=false doesn't get rendered to the client and,
    naturally, doesn't come back in postbacks. If you are interested in the
    hidden value either on client side or in postbacks, hide with a css rule

    Eliyahu Goldin,
    Software Developer & Consultant
    Microsoft MVP [ASP.NET]
    Eliyahu Goldin, Mar 22, 2007
    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.