473,405 Members | 2,379 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,405 software developers and data experts.

COME ONNNNNNNNNN

I've asked this 5 times today.
Please help.
Should be the First thing ASP.net should do

Hi.
I can't figure this one.
How to I get the value out of column3 "Item Price" in a gridview?
It's in the row I select.
Mar 1 '06 #1
18 1202
Roy
I'm assuming you're attempting to edit the gridview?

Research (in the codebehind) in the edit gridview sub the OldValue and
NewValue functionality. They will allow you to narrow down to a single
value.

*** Sent via Developersdex http://www.developersdex.com ***
Mar 1 '06 #2
No, I'm trying to get the value of the cell.

"Roy" <SP*******@gmail.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
I'm assuming you're attempting to edit the gridview?

Research (in the codebehind) in the edit gridview sub the OldValue and
NewValue functionality. They will allow you to narrow down to a single
value.

*** Sent via Developersdex http://www.developersdex.com ***

Mar 1 '06 #3
Try this?

Ken
Microsoft MVP [ASP.NET]

<%@ Page Language="VB" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<script runat="server">

Protected Sub Page_Load _
(ByVal sender As Object, _
ByVal e As System.EventArgs)
If Not IsPostBack Then
GridView1.DataSource = CreateDataSource()
GridView1.DataBind()
End If
End Sub

Protected Sub GridView1_RowCommand _
(ByVal sender As Object, _
ByVal e As System.Web.UI.WebControls.GridViewCommandEventArgs )
Dim gdvRow As GridViewRow
Dim gdvCell As TableCell
gdvRow = GridView1.Rows(e.CommandArgument)
gdvCell = gdvRow.Cells(2)
Response.Write(gdvCell.Text)
End Sub

Function CreateDataSource() As Data.DataTable
Dim dt As New Data.DataTable
Dim dr As Data.DataRow
dt.Columns.Add(New Data.DataColumn _
("IntegerValue", GetType(Int32)))
dt.Columns.Add(New Data.DataColumn _
("StringValue", GetType(String)))
dt.Columns.Add(New Data.DataColumn _
("CurrencyValue", GetType(Double)))
dt.Columns.Add(New Data.DataColumn _
("Boolean", GetType(Boolean)))
Dim i As Integer
For i = 0 To 5
dr = dt.NewRow()
dr(0) = i
dr(1) = "Item " + i.ToString()
dr(2) = 1.23 * (i + 1)
dr(3) = (i = 4)
dt.Rows.Add(dr)
Next i
Return dt
End Function

</script>

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Get the value of a column</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:gridview id="GridView1" runat="server"
autogenerateselectbutton="True" onrowcommand="GridView1_RowCommand">
</asp:gridview>

</div>
</form>
</body>
</html>

"Gerry A" <df******@aasdf.com> wrote in message
news:CY********************@comcast.com...
I've asked this 5 times today.
Please help.
Should be the First thing ASP.net should do

Hi.
I can't figure this one.
How to I get the value out of column3 "Item Price" in a gridview?
It's in the row I select.

Mar 1 '06 #4
Roy
Then you need to research the oldvalue/newvalue functionality in the
code-behind.
From: Gerry A

No, I'm trying to get the value of the cell.

"Roy" <SP*******@gmail.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
I'm assuming you're attempting to edit the gridview?

Research (in the codebehind) in the edit gridview sub the OldValue and
NewValue functionality. They will allow you to narrow down to a single
value.


*** Sent via Developersdex http://www.developersdex.com ***
Mar 1 '06 #5
???huh???

it is this simple

GridView1.SelectedRow.Cells(i).Text
Mar 1 '06 #6
HK
Maybe if you asked with more detail, and if you waited patiently, you'd get
help.

Other people posted questions yesterday and you don't see them whining 4
more times within hours that none of the UNPAID helpers in this forum aren't
yet replying. People reply to what they can understand and to what they
know the answers, and often in a first come, first served order. If you
don't like the way the free system of people-helping-people works in a
newsgroup, then you can always call Microsoft and part with $250.

The newsgroup norm, IMO, is to wait a day or two, and then re-post with
"re-post" in the subject so people might try harder.

"Gerry A" <df******@aasdf.com> wrote in message
news:CY********************@comcast.com...
I've asked this 5 times today.
Please help.
Should be the First thing ASP.net should do

Hi.
I can't figure this one.
How to I get the value out of column3 "Item Price" in a gridview?
It's in the row I select.

Mar 1 '06 #7
Nearly.

See my answer to your first post for sample code.

Ken

"Gerry A" <df******@aasdf.com> wrote in message
news:p4******************************@comcast.com. ..
???huh???

it is this simple

GridView1.SelectedRow.Cells(i).Text

Mar 1 '06 #8
Also, when posting make sure you are using the correct news server. Don't
use your ISP's news server to post messages here, go directly to
news.microsoft.com. If you use your ISP's news server there's no guarantee
that they'll even end up here as the news server may or may not forward the
message here. There's only one other message in this newsgroup from a Gerry
A posted this morning. Other than that, the other three times are missing.
Give it a while as it sometimes just takes time for someone to help you. If
you post messages with a subject like this one, chances are you're going to
only anger the people that do come here and try to take the time to answer
things. Remember, nobody here is paid to answer questions.

Mark Fitzpatrick
Microsoft MVP - FrontPage

"Gerry A" <df******@aasdf.com> wrote in message
news:CY********************@comcast.com...
I've asked this 5 times today.
Please help.
Should be the First thing ASP.net should do

Hi.
I can't figure this one.
How to I get the value out of column3 "Item Price" in a gridview?
It's in the row I select.

Mar 1 '06 #9
Well Put!

:)

Jeremy Reid
http://hgtit.com

Mar 1 '06 #10
maybe you should donate your free time to the whiner's groups, since you
have all the answers for whiners.
"HK" <re**************@notreal.com> wrote in message
news:b%***************@tornado.socal.rr.com...
Maybe if you asked with more detail, and if you waited patiently, you'd
get
help.

Other people posted questions yesterday and you don't see them whining 4
more times within hours that none of the UNPAID helpers in this forum
aren't
yet replying. People reply to what they can understand and to what they
know the answers, and often in a first come, first served order. If you
don't like the way the free system of people-helping-people works in a
newsgroup, then you can always call Microsoft and part with $250.

The newsgroup norm, IMO, is to wait a day or two, and then re-post with
"re-post" in the subject so people might try harder.

"Gerry A" <df******@aasdf.com> wrote in message
news:CY********************@comcast.com...
I've asked this 5 times today.
Please help.
Should be the First thing ASP.net should do

Hi.
I can't figure this one.
How to I get the value out of column3 "Item Price" in a gridview?
It's in the row I select.


Mar 1 '06 #11
well it did end up there so your point is moooooooooooooooooooot
"Mark Fitzpatrick" <ma******@fitzme.com> wrote in message
news:Or**************@TK2MSFTNGP12.phx.gbl...
Also, when posting make sure you are using the correct news server. Don't
use your ISP's news server to post messages here, go directly to
news.microsoft.com. If you use your ISP's news server there's no guarantee
that they'll even end up here as the news server may or may not forward
the message here. There's only one other message in this newsgroup from a
Gerry A posted this morning. Other than that, the other three times are
missing. Give it a while as it sometimes just takes time for someone to
help you. If you post messages with a subject like this one, chances are
you're going to only anger the people that do come here and try to take
the time to answer things. Remember, nobody here is paid to answer
questions.

Mark Fitzpatrick
Microsoft MVP - FrontPage

"Gerry A" <df******@aasdf.com> wrote in message
news:CY********************@comcast.com...
I've asked this 5 times today.
Please help.
Should be the First thing ASP.net should do

Hi.
I can't figure this one.
How to I get the value out of column3 "Item Price" in a gridview?
It's in the row I select.


Mar 1 '06 #12
looks like someone isn't going to get a great deal of help around here in future.
Mar 1 '06 #13
well it did end up there so your point is moooooooooooooooooooot\


Uh, it didn't. So your comment is ruuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuude.

-Darrel
Mar 1 '06 #14
> maybe you should donate your free time to the whiner's groups, since you
have all the answers for whiners.


Pot: Meet kettle.

-Darrel
Mar 1 '06 #15
> well it did end up there so your point is moooooooooooooooooooot

I wouldn't be so sure of that, Gerry. You're already alienating the people
whose help you're likely to need quite often in the future, and starting to
get a reputation as someone not worth helping.

Mark is one of those people, and you would do well to take his advice. If
you start taking it now, that reputation will be aborted at birth.

Remember that, after all is said and done, you bear the responsibility for
what you get out of life and people (and newsgroups). Play to win.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
A brute awe as you,
a Metallic hag entity, eat us.
"Gerry A" <df******@aasdf.com> wrote in message
news:aa******************************@comcast.com. ..
well it did end up there so your point is moooooooooooooooooooot

Mar 2 '06 #16
"Gerry A" <df******@aasdf.com> wrote in message
news:s5********************@comcast.com...
maybe you should donate your free time to the whiner's groups, since you
have all the answers for whiners.


I wonder how many of the regulars in this newsgroup just killfiled you (as
I'm just about to...) because of this...?
Mar 2 '06 #17
I didn't killfile him.

I'll wait for his next few posts before doing that, if needed.
I think he has a wonderful opportunity to learn from this experience.

It will be up to him if he does.

Kevin's post has extremely good advice for him.

Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
===================================
"Mark Rae" <ma**@markN-O-S-P-A-M.co.uk> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
"Gerry A" <df******@aasdf.com> wrote in message news:s5********************@comcast.com...
maybe you should donate your free time to the whiner's groups, since you have all the answers for
whiners.


I wonder how many of the regulars in this newsgroup just killfiled you (as I'm just about to...)
because of this...?

Mar 2 '06 #18
I think the microsoft newsreader cut off your anwer to my actual question. I
don't see it.
Mar 2 '06 #19

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

Similar topics

3
by: Chris Tanger | last post by:
I am creating a class that has a method "Write" that I wish to make threadsafe. The method must block calling threads until the task performed in write is complete. Only 1 thread at a time can...
3
by: Newbee Adam | last post by:
what OS come with .NET framework!? How can I install .Net Framework on say a win 98 and win 2000 machine? does the .Net framework need for the win 98 and 2000 machone come with visual...
2
by: luckdor | last post by:
Mi spiego meglio: Come sicuramente sapete RegMon È un'applicazione che monitorizza il registro di Windows; praticamente rivela tutte le chiamate o le scritture nel registro. Non riesco a...
385
by: Xah Lee | last post by:
Jargons of Info Tech industry (A Love of Jargons) Xah Lee, 2002 Feb People in the computing field like to spur the use of spurious jargons. The less educated they are, the more they like...
26
by: vlsidesign | last post by:
I am a newbie and going through "The C programming language" by Kernighan & Richie on my own time (I'm not a programmer but I want to learn because it can save me time in my normal job, and it is...
1
by: Karthiga1984 | last post by:
Hi Table Structure company name Phone No Products Example Company Name Phone No Products
12
by: Pablo | last post by:
Hi at all I have a little problem (for you) that for me is a mission impossible. I have two web site The first site conain a link to the 2th. and 2th.web site contain a link to the first. ...
85
by: pereges | last post by:
#include <stdio.h> typedef struct { double x, y, z; }vector; int main(void) { int i;
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
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
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
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
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.