Dear All,
I have data which display on the GridView.
GridView contain 3 Column (ProductId, ProductCode and Description).
I would like to display only Product Code and Description so I hide
ProductId Column.
Is there any command so I can take value of first column which is Product
ID?
In other words, how can I get value from hidden column on Grid View?
TIA,
Gun 3 3501
The value should still be there and available like the shown values.
Walk through it with the debugger and place breakpoint in the Load
event. Then add your GridView reference to the Watch. You can expand
it out to see exactly where you can find your value.
Placing an ID as a hidden column on a GridView is common practice and
it was done with the DataGrid in ASP.NET 1.1. It is the only real way
to know what data that row was bound to originally.
Brennan
Gunawan wrote:
Dear All,
I have data which display on the GridView.
GridView contain 3 Column (ProductId, ProductCode and Description).
I would like to display only Product Code and Description so I hide
ProductId Column.
Is there any command so I can take value of first column which is Product
ID?
In other words, how can I get value from hidden column on Grid View?
TIA,
Gun
Actually I am using SelectedRow Object
GridViewRow row = gv1.SelectedRow;
But I can not get value from column #1 which I hide
Or I should use something else?
FYI I use gv1.DataSource = ds
ds is a dataset object, instead I bound it with SQL Data Source
TIA,
Gun
<of******@gmail.comwrote in message
news:11**********************@i3g2000cwc.googlegro ups.com...
The value should still be there and available like the shown values.
Walk through it with the debugger and place breakpoint in the Load
event. Then add your GridView reference to the Watch. You can expand
it out to see exactly where you can find your value.
Placing an ID as a hidden column on a GridView is common practice and
it was done with the DataGrid in ASP.NET 1.1. It is the only real way
to know what data that row was bound to originally.
Brennan
Gunawan wrote:
>Dear All, I have data which display on the GridView. GridView contain 3 Column (ProductId, ProductCode and Description). I would like to display only Product Code and Description so I hide ProductId Column. Is there any command so I can take value of first column which is Product ID? In other words, how can I get value from hidden column on Grid View?
TIA, Gun
One thing I've used in this case, was to duplicate the label (or whatever
control), along with its databindings inside one of the visible controls, as
a template -
then, make that control invisible - - the column is visible, but the control
is not - but it's still available to get the value
--
David Wier
MVP/ASPInsider http://aspnet101.com http://aspexpress.com
"Gunawan" <jg**********@gmail.comwrote in message
news:Or**************@TK2MSFTNGP06.phx.gbl...
Actually I am using SelectedRow Object
GridViewRow row = gv1.SelectedRow;
But I can not get value from column #1 which I hide
Or I should use something else?
FYI I use gv1.DataSource = ds
ds is a dataset object, instead I bound it with SQL Data Source
TIA,
Gun
<of******@gmail.comwrote in message
news:11**********************@i3g2000cwc.googlegro ups.com...
The value should still be there and available like the shown values.
Walk through it with the debugger and place breakpoint in the Load
event. Then add your GridView reference to the Watch. You can expand
it out to see exactly where you can find your value.
Placing an ID as a hidden column on a GridView is common practice and
it was done with the DataGrid in ASP.NET 1.1. It is the only real way
to know what data that row was bound to originally.
Brennan
Gunawan wrote:
Dear All,
I have data which display on the GridView.
GridView contain 3 Column (ProductId, ProductCode and Description).
I would like to display only Product Code and Description so I hide
ProductId Column.
Is there any command so I can take value of first column which is
Product
ID?
In other words, how can I get value from hidden column on Grid View?
TIA,
Gun
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: theKirk |
last post by:
using Visual Studio 2005
C# ASP.NET
I know there has to be a simple way to do this....I want to use C# in a code
behind for aspx.
Populate a GridView from an xml file
Add Fields to the...
|
by: Nalaka |
last post by:
Hi,
I have a gridView (grid1), which as a templateColumn.
In the template column, I have put in a gridView (grid2) and a
ObjectDataSource (objectDataSource2).
Question is... How to I pass the...
|
by: Nalaka |
last post by:
Hi,
I have two questions about gridViews.
1. How can I intercept the row/column values at loading to change values?
2. After I update a row (using default update functionality), how can I...
|
by: |
last post by:
Hello,
Does anyone have an idea on how I can filter the data in the gridview
control that was returned by an sql query?
I have a gridview that works fine when I populate it with data. Now I...
|
by: Giovanni |
last post by:
Dear Friends/Gurus,
I have exhausted myself and have yet no solution to the following:
I have an ASP.NET 2.0 Survey type application. On a page, I have placed
a GridView which is bound to an...
|
by: Chris |
last post by:
Hi,
I read about client callback and i have a question.
Assume the option "sorting" is set in a gridview.
Each time the user clicks on a fieldname, the data are sorted.
My question is: are...
|
by: Gonza |
last post by:
Hi group, i have a question relatred to gridview and postback (i should
probably know this by now, considering i've been working with .net for
a few years now, but baahh). Why could a gridview...
|
by: Barry L. Camp |
last post by:
Hi all,
Wondering if someone can help with a nagging problem I am having using
a GridView and an ObjectDataSource. I have a simple situation where I
am trying to delete a row from a table, but...
|
by: =?Utf-8?B?R2VyaGFyZA==?= |
last post by:
I have a vb.net 2.0 app that is loading a GridView with a DataSource that is
returned from a function.
The definitions in the function are:
Dim ReportDS As DataSet = New DataSet
Dim...
|
by: Cirene |
last post by:
This is confusing...
I have a gridview (gv1) with another gridview (gv2) inside of it.
gv1 has a bunch of house listings and within each row is a group of related
house pictures (gv2).
I'm...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
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,...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
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...
| |