 |
| ASP.NET 2.0 Professional If you are an experienced ASP.NET programmer, this is the forum for your 2.0 questions. Please also see the Visual Web Developer 2005 forum. |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the ASP.NET 2.0 Professional section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
|
|
|
|

April 5th, 2006, 04:28 PM
|
|
Authorized User
|
|
Join Date: Mar 2006
Posts: 23
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Pulling data from the selected recordin the DGRID
Hi people, burning your eyes again?
I got a datagrid and once I select a records - this is for admin profile management page - I want to pull out its last activity date. sounds ok, but.
I try this, but it doesn work:
ublic Sub SClass(ByVal sender As Object, ByVal e As System.EventArgs)
Session("LAD") = GridView2.SelectedRow("LastActivityDate")
Label1.Text = CStr((Session("LAD")))
End Sub
No errors, no action either!
I want to get this value into the text box. Also, a simple question, can a textbox be databound?
thanx
mdm
|
|

April 6th, 2006, 12:37 AM
|
|
Friend of Wrox
|
|
Join Date: Nov 2003
Posts: 1,348
Thanks: 0
Thanked 5 Times in 5 Posts
|
|
Quote:
quote:
GridView2.SelectedRow("LastActivityDate")
|
This is incorrect syntax, how it even compiles and runs is beyond me. Look up the SelectedRow property in vs help for examples.
Textboxes in 2.0 are not bindable, you need to set the text directly as you are doing it
|
|

April 7th, 2006, 12:00 PM
|
|
Authorized User
|
|
Join Date: Mar 2006
Posts: 23
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Hi JB
AGREE, now I see the faulty code. I have tried this instead, but to no avail.
Protected Overridable Sub ExtractRowValues( _
ByVal fieldValues As IOrderedDictionary)
Me.ExtractRowValues(CType("DetailsView1", IOrderedDictionary))
'Label4.Text = CStr(fieldValues.Values)
End Sub
any suggestions?
ta
mdm
|
|

April 7th, 2006, 12:33 PM
|
|
Authorized User
|
|
Join Date: Mar 2006
Posts: 23
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Jim,
moreover, what if there is just one record, selected thing will not work? How to get it out then?
mdm
|
|

April 7th, 2006, 03:53 PM
|
|
Friend of Wrox
|
|
Join Date: Nov 2003
Posts: 1,348
Thanks: 0
Thanked 5 Times in 5 Posts
|
|
What exactly are you trying to do? Do you have a gridview and then upon selection of a row you want a value pulled into a textbox?
|
|

April 9th, 2006, 07:41 AM
|
|
Authorized User
|
|
Join Date: Mar 2006
Posts: 23
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
jim,
that correct. however, in case of several records upon selection will work great. what ifthere is only one record, by definition can I get LatActivity Date for this onerecord? Container eval then?
thanx
mdm
|
|

April 9th, 2006, 09:36 PM
|
|
Friend of Wrox
|
|
Join Date: Nov 2003
Posts: 1,348
Thanks: 0
Thanked 5 Times in 5 Posts
|
|
Yes
|
|
 |