Hiding and Showing Columns in Editable GridView

Discussion in 'ASP .Net' started by =?Utf-8?B?Sm9zaCBTY2htaWR0?=, Mar 21, 2007.

  1. 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?
    =?Utf-8?B?Sm9zaCBTY2htaWR0?=, Mar 21, 2007
    #1
    1. Advertising

  2. =?Utf-8?B?Sm9zaCBTY2htaWR0?=

    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
    www.jumptree.com

    On Mar 21, 4:15 pm, Josh Schmidt
    <> wrote:
    > 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?
    Liming, Mar 22, 2007
    #2
    1. Advertising

  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
    display:none.

    --
    Eliyahu Goldin,
    Software Developer & Consultant
    Microsoft MVP [ASP.NET]
    http://msmvps.com/blogs/egoldin
    http://usableasp.net


    "Josh Schmidt" <> wrote in message
    news:...
    >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?
    Eliyahu Goldin, Mar 22, 2007
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Amber
    Replies:
    1
    Views:
    623
    Alvin Bruney
    Oct 11, 2003
  2. =?Utf-8?B?c3Jpbml2YXM=?=

    Hiding columns in GridView Control

    =?Utf-8?B?c3Jpbml2YXM=?=, Aug 3, 2006, in forum: ASP .Net
    Replies:
    6
    Views:
    17,733
    rishibajaj4350
    Apr 17, 2009
  3. Amber

    Hiding and Showing Columns in the DataGrid Control...

    Amber, Oct 7, 2003, in forum: ASP .Net Datagrid Control
    Replies:
    1
    Views:
    166
    Alvin Bruney
    Oct 11, 2003
  4. Amber

    Hiding and Showing Columns in the DataGrid Control...

    Amber, Oct 7, 2003, in forum: ASP .Net Web Controls
    Replies:
    1
    Views:
    164
    Alvin Bruney
    Oct 11, 2003
  5. ton
    Replies:
    2
    Views:
    205
    Alvin Bruney [MVP]
    Feb 11, 2004
Loading...

Share This Page