Print Page | Close Window

Pulling Info. from DetailsView.

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: ASP.NET Discussion
Forum Description: Discussion and chat on ASP.NET related topics.
URL: https://forums.webwiz.net/forum_posts.asp?TID=15326
Printed Date: 28 March 2026 at 11:06pm
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: Pulling Info. from DetailsView.
Posted By: davidshq
Subject: Pulling Info. from DetailsView.
Date Posted: 01 June 2005 at 3:33pm
Say you have a DetailsView and you want to pull the ID number of the row information from it, how would you do this? In GridView you just tell it SelectedRow, but w/DetailsView it is only one row?
David.


-------------
- http://www.davemackey.net/" rel="nofollow - Dave Mackey - Virtual Home.



Replies:
Posted By: Mart
Date Posted: 01 June 2005 at 3:38pm
You need to set the KeyField (or something like that) property of your DataView to the ID field in your database.
You can then just go

Dim ID As Integer = DetailsView1.Keys(DetailsView.SelectedRow.Index)



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net