Hiding and Showing Columns in Editable GridView

G

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?
 
L

Liming

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
 
E

Eliyahu Goldin

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
 

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

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,050
Latest member
AngelS122

Latest Threads

Top