Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Professional
|
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
 
Old April 5th, 2006, 04:28 PM
MDM MDM is offline
Authorized User
 
Join Date: Mar 2006
Posts: 23
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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

 
Old April 6th, 2006, 12:37 AM
Friend of Wrox
 
Join Date: Nov 2003
Posts: 1,348
Thanks: 0
Thanked 5 Times in 5 Posts
Default

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

 
Old April 7th, 2006, 12:00 PM
MDM MDM is offline
Authorized User
 
Join Date: Mar 2006
Posts: 23
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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

 
Old April 7th, 2006, 12:33 PM
MDM MDM is offline
Authorized User
 
Join Date: Mar 2006
Posts: 23
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Jim,

moreover, what if there is just one record, selected thing will not work? How to get it out then?

mdm

 
Old April 7th, 2006, 03:53 PM
Friend of Wrox
 
Join Date: Nov 2003
Posts: 1,348
Thanks: 0
Thanked 5 Times in 5 Posts
Default

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?

 
Old April 9th, 2006, 07:41 AM
MDM MDM is offline
Authorized User
 
Join Date: Mar 2006
Posts: 23
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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

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

Yes






Similar Threads
Thread Thread Starter Forum Replies Last Post
SSIS Not pulling data correctly chevy SQL Server 2005 0 February 26th, 2008 04:12 PM
Ajax not pulling back data gmoney BOOK: Professional Ajax ISBN: 978-0-471-77778-6 1 August 22nd, 2006 02:31 AM
pulling data from webpage zeeonline XSLT 3 July 27th, 2006 03:04 PM
placeholder controls -- pulling data Fubar ASP.NET 1.0 and 1.1 Professional 6 September 8th, 2005 09:08 AM
Check boxe pulling data Calibus Classic ASP Databases 3 August 7th, 2004 02:11 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.