473,503 Members | 13,028 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Hiding and Showing Columns in Editable GridView

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?
Mar 21 '07 #1
2 1631
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
<JoshSchm...@discussions.microsoft.comwrote:
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?

Mar 22 '07 #2
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" <Jo*********@discussions.microsoft.comwrote in message
news:2C**********************************@microsof t.com...
>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?

Mar 22 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
2203
by: c.anandkumar | last post by:
Hi All - I have some problems getting a small piece of javascript working correctly for Firefox. Here is what I am trying to do - 1. I have a form (like a search form) 2. I have many groups...
1
840
by: Amber | last post by:
The DataGrid allows you to make columns visible or invisible on demand - even edit and other special columns. This article will show you how it is done. Some developers have reported problems...
5
1618
by: srinivas | last post by:
Hi, I have binded a dataset to a gridview control at run time. I'm fetching 5 columns from the database. But while displaying it on the screen i want to show only 3 columns. I tried with...
1
1800
by: Dica | last post by:
i need to allow the user to select a row from my dataGrid for editing. as such, i include the record ID in the first column and then extract like so when retrieving the record details: protected...
2
2890
by: =?Utf-8?B?SmF5IFBvbmR5?= | last post by:
Based on wether a row is selected in a GridView I need to HIDE the last two columns of a gridview. I do NOT need to make the cells invisible I want to hide the entire column. When I set the...
4
9766
by: mohaaron | last post by:
This seems like it should be simple to do but for some reason I have been unable to make it work. I would like to databind a SqlDataSource to a GridView during the click event of a button. This...
0
1246
by: hedgracer | last post by:
I have a gridview that has six columns. I need to hide the last column (i.e. not download it) in the download from gridview to excel. My current code (which downloads the entire gridview) is as...
1
993
by: taa | last post by:
protected void LoadExercises(object sender, EventArgs e) { // Navn, (Beskrivelse), Type, Exid, Target var exercises = from ex in context.Exercises select new {exerciseId = ex.ExerciseId,...
9
12026
by: ally | last post by:
Hi, I am programmatically binding gridview to a datatable. I want to hide 2 columns. I can be done by adding code in RowCreated event of gridview like e.Row.Cells.Visible = false; ...
0
7212
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7098
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7364
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7017
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
1
5026
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3174
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1524
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
751
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
405
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.