473,406 Members | 2,816 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Grid View Row Value

CK
How can I get this value at runtime? I want the value of the row as it's
created. Any ideas?
Oct 31 '06 #1
3 4334
Look at RowDataBound event. It fires for every grid row as it gets
databound, in other words gets populated. The row object is available in
event parameters.

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]

"CK" <c_**********@hotmail.comwrote in message
news:7r****************@newssvr12.news.prodigy.com ...
How can I get this value at runtime? I want the value of the row as it's
created. Any ideas?


Oct 31 '06 #2
CK
I can get a handle on on the row and I can look at
e.Row.DataItem.Row.ItemArray, is there a shorter property i can use to get
the datakey value of the row? Thanks for your help.

~Ck

"Eliyahu Goldin" <re*************@monarchmed.comwrote in message
news:%2****************@TK2MSFTNGP03.phx.gbl...
Look at RowDataBound event. It fires for every grid row as it gets
databound, in other words gets populated. The row object is available in
event parameters.

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]

"CK" <c_**********@hotmail.comwrote in message
news:7r****************@newssvr12.news.prodigy.com ...
>How can I get this value at runtime? I want the value of the row as it's
created. Any ideas?



Oct 31 '06 #3
If you want the value as it comes to the grid view, use e.Row.Cells
collection.

If you want the value as it is in the database, typecast e.Row.DataItem to
your datasource row type. For datatable it will be
(DataRowView)e.Row.DataItem.

If you need to get the datakey value for a row, you don't need to do it in
the RowDataBound event. Use
myGridView.DataKeys[rowNumber].Value
after the whole gridview is databound.

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]
"CK" <c_**********@hotmail.comwrote in message
news:iw******************@newssvr21.news.prodigy.c om...
>I can get a handle on on the row and I can look at
e.Row.DataItem.Row.ItemArray, is there a shorter property i can use to get
the datakey value of the row? Thanks for your help.

~Ck

"Eliyahu Goldin" <re*************@monarchmed.comwrote in message
news:%2****************@TK2MSFTNGP03.phx.gbl...
>Look at RowDataBound event. It fires for every grid row as it gets
databound, in other words gets populated. The row object is available in
event parameters.

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]

"CK" <c_**********@hotmail.comwrote in message
news:7r****************@newssvr12.news.prodigy.co m...
>>How can I get this value at runtime? I want the value of the row as it's
created. Any ideas?




Nov 1 '06 #4

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

Similar topics

5
by: pmud | last post by:
Hi, I need to display columns in a data grid based on 7 different queries. Now I have 32 questions: 1. Is it possble to have 1 single data adapter with 7 queries & 1 data set or do I need to...
12
by: pmud | last post by:
Hi, I am using teh following code for sorting the data grid but it doesnt work. I have set the auto generate columns to false. & set the sort expression for each field as the anme of that...
4
by: Peter Bailey | last post by:
I have a vba string taht dynamically creates the query which has two dates in it that it grabs off an open form as a string from the textbox. What I generate in vba is: SELECT DOSMBK.Date,...
3
by: pmud | last post by:
Hi, I have a web page (asp.net, code:c#). I havean html table with text boxes. Based on the user input , records are displayed in the data grid below it. Now the datagrid has a large no. of...
0
by: Gian Paolo | last post by:
this is something really i can't find a reason. I have a form with a tabcontrol with tree pages, in the second page there is a Data GRid View. Plus i have a class. When i open the form i...
0
by: Kondapanaidu | last post by:
Hi, I am using Visual Studio 2005 ASP.NET Using C#. My form has one. Grid view This it self having Text box and Dropdowns. I Have coule of questions like?
1
by: =?Utf-8?B?TG95b2xhIHN0YWxpbg==?= | last post by:
Hi, I am using ASP.Net 2.0 version and Windows'XP OS. I am useing the Grid view control to display the user details along with the paging concept provided by the grid view control. When i...
0
by: =?Utf-8?B?Ym9iYnk=?= | last post by:
I have a Grid View. Here I have a column "Active". I attached this GridView to objectDataSource. In database this field has true or false value.(1 or 0). But in Grid View I want to show that if...
2
by: rameshgohil | last post by:
I am using grid view and a button column in it using <itemTemplate> but I am not able to rerive cell value of a selected row from grid view. I have tried the following to methods in Row_command...
1
by: John | last post by:
Hi I have a grid view bound to an SqlDataSource. One of the fields in grid view is a hyperlink field. How can I set the hyperlink field's navigationurl to the value of a field coming form the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
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...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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...
0
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
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
Oralloy
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,...
0
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...

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.