Retreive Values From Dynamic Data Details View

Posted on 2009-02-13
Last Modified: 2012-08-14
I am working on someone's 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.
Question by:Chiliyago
    LVL 8

    Expert Comment

    HI There,

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

    LVL 15

    Accepted Solution

    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

    Featured Post

    Free Trending Threat Insights Every Day

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Join & Write a Comment

    In an ASP.NET application, I faced some technical problems. In this article, I list them out and show the solutions that I found.  I hope it will be useful. Problem: After closing a pop-up window, the parent page should be refreshed automaticall…
    A quick way to get a menu to work on our website, is using the Menu control and assign it to a web.sitemap using SiteMapDataSource. Example of web.sitemap file: (CODE) Sample code to add to the page menu: (CODE) Running the application, we wi…
    Need more eyes on your posted question? Go ahead and follow the quick steps in this video to learn how to Request Attention to your question. *Log into your Experts Exchange account *Find the question you want to Request Attention for *Go to the e…
    Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

    755 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    25 Experts available now in Live!

    Get 1:1 Help Now