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 3344322
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T01:03:22+00:00 2026-05-18T01:03:22+00:00

I’m using a GridView and Details View and my datasource is a custom ObjectDataSource

  • 0

I’m using a GridView and Details View and my datasource is a custom ObjectDataSource that returns a DataSet.

This isn’t a SQL server, I’m using an LDAP query to get users from Active Directory.

I have two custom datasources in the ASPX page with one bound to the GridView and one to the DetailsView. They both have SelectMethods and Parameters that work.

The GridView works perfectly. When I run the query against the Active Directory, I get my list of people in the GridView with an autogenerated select link. I can click on this link and it passes whichever value I want via the DataKeyNames to the SelectedIndexChanged event.

What I’m doing in this event is setting the parameter for the ObjectDataSource for the DetailsView control. It does call into the custom class and return back a DataSet that contains ONE USER.

What’s interesting here is that when I setup this ObjectDataSource in the ASPX page, I give it a Default parameter value. When the page loads, the DetailsView control shows up with the values returned via the default parameter.

So…I know this works to some degree.

However, when I set the parameter in the SelectedIndexChanged event for the GridView, the select method in the custom class runs and returns the proper DataSet, but the DetailsView control is not updated with the new information.

Here’s the ASPX code for ObjectDataSource for the DetailsView:

<asp:ObjectDataSource ID="_prvODSDetailsView" 
                  SelectMethod="_pubGetSingleUserDataSetByKerberosID"
                  TypeName="NotImportant"
                  runat="server">
   <SelectParameters>
  <asp:Parameter Direction="Input" Name="param_KerberosID" Type="String" DefaultValue="somedefaultvalue" />
   </SelectParameters>
</asp:ObjectDataSource>  

Here’s my DetailsView code:

<asp:DetailsView ID="_prvDetailsViewShown" 
          CssClass="detailgrid"
          GridLines="None"
          DefaultMode="Edit"
          EmptyDataText="<No Details Available>"
          AutoGenerateRows="true"
          DataKeyNames="KerberosID"
          DataSourceID="_prvODSDetailsView"
          Width="100%"
          runat="server">
</asp:DetailsView>

Just to reiterate. This works on the first page load using the default value from the parameter.

void _prvGridView_SelectedIndexChanged( object sender, EventArgs e )
{
    DataKey k = _prvGridView.SelectedDataKey;
    string kerberosID = k.Value.ToString();
    Parameter parameter = new Parameter( "param_KerberosID", TypeCode.String, kerberosID );
    _prvODSDetailsView.SelectParameters[ 0 ] = parameter;
}

What I’m expecting to happen is the binding occurs and the control gets automatically updated. In fact, I’m pretty sure the DetailsView binding does occur, but the control never gets updated.

What am I missing?

  • 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-18T01:03:22+00:00Added an answer on May 18, 2026 at 1:03 am

    Well, I found the answer. My GridView is in an UpdatePanel (ASP .NET AJAX) and the DetailsView as not. Apparently, you can’t have that.

    When removed all of the AJAX components, it worked.

    When I put the DetailsView in the SAME UpdatePanel as the GridView, it also worked.

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

Sidebar

Related Questions

No related questions found

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.