• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 330
  • Last Modified:

Retreive Values From Dynamic Data Details View

I am working on someone's asp.net page which is a basic DynamicData page with DetailsView.  Since there are no templates on this DetailsView I am not sure how to retrieve values from it in my code behind.  I would normally use FindControl but since everything is autgenerated I am not sure how to go about this.  Please advise.
0
Chiliyago
Asked:
Chiliyago
1 Solution
 
MrAgileCommented:
HI There,

The details view has events that your are able to access.  Start here:

http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.detailsview.aspx

Sean
0
 
aibusinesssolutionsCommented:
I would use the ItemCreated function of the DetailsView, here is a little sample to get you started.

Dim dv As DetailsView = CType(sender, DetailsView)
Dim userID As String = dv.DataItem("userID")

'loop through each field in the detailsview
For Each dr As DetailsViewRow In dv.Controls(0).Controls
    If dr.RowType = DataControlRowType.DataRow Then
           'do something to the rows here
    End If
Next
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now