Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 786741
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T21:05:28+00:00 2026-05-14T21:05:28+00:00

I am creating a GridView/DetailsView page. I have a grid that displays a bunch

  • 0

I am creating a GridView/DetailsView page. I have a grid that displays a bunch of rows, when a row is selected it uses a DetailsView to allow for Insert/Update.

My question is what is the best way to link these? I do not want to reach out to the web service again, all the data i need is in the selected grid view row. I basically have 2 separate data sources that share the same “DataObjectTypeName”, the first data source retrieves the data, and the other to do the CRUD.

What is the best way to transfer the Selected Grid View row to the Details View? Am I going to have to manualy handle the Insert/Update events and call the data source myself?

Is there no way to link these two so they use the same data source ?

  <asp:GridView ID="gvDetails" runat="server" DataKeyNames="ID, Code"
                DataSourceID="odsSearchData" >
   <Columns>
        <asp:BoundField DataField="RowA" HeaderText="A" SortExpression="RowA" />
        <asp:BoundField DataField="RowB" HeaderText="B" SortExpression="RowB" />
        <asp:BoundField DataField="RowC" HeaderText="C" SortExpression="RowC" />



    ....Code...

 <asp:DetailsView ID="dvDetails" runat="server" DataKeyNames="ID, Code"
                DataSourceID="odsCRUD" GridLines="None" DefaultMode="Edit" AutoGenerateRows="false"
                Visible="false" Width="100%">
         <Fields>
            <asp:BoundField DataField="RowA" HeaderText="A" SortExpression="RowA" />
           <asp:BoundField DataField="RowB" HeaderText="B" SortExpression="RowB" />
           <asp:BoundField DataField="RowC" HeaderText="C" SortExpression="RowC" />

...
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T21:05:29+00:00Added an answer on May 14, 2026 at 9:05 pm

    The standard way to do it would be to have the selected item of the griview be a control parameter to the objectdatasource you have wired up to the detailsview. I would probably not worry too much about the overhead of retreiving data that you already have unless you are catering to users with such slow connections that you want to avoid roundtrips to the webserver at all costs.

    If you really want to avoid that thenyou could pull the data out of the gridview using javascript/jquery and then do your inserts/updates via ajax calls. It would require lots more coding though.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an ASPX page that is dynamically creating a gridview from a database
I have a gridview I am populating it by creating a datatable filling that
I'm having trouble creating a Gridview that can span 2 rows for each record.
i'm creating a shopping website. i have a gridview that is bound to an
I am creating an activity that displays 9 images in a GridView. I want
I have a DataTable that I am creating and binding to a GridView. Currently
I have to insert fix number of rows to gridview. I am not using
I'm currently building a Gridview that has expandable rows. Each row contains a dynamically
i have a gridview that creates a new row with a new gridview in
I'm creating a gridview dynamically based on number of users selected but want to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.