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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T11:59:52+00:00 2026-06-08T11:59:52+00:00

I know that someone is going to want code for this issue but the

  • 0

I know that someone is going to want code for this issue but the plumbing code for a Gridview, the Object Data Source and all its associated events, along with the wired up business objects is too much no matter how I could condense it. However I think the question can still be answered.

I have an ObjectDataSource associated with a ASP.NET Gridview and a default SelectMethod named GetALLNames. This method say brings back 100 records by default and binds them to the GridView.

However on this page I have a ‘Search’ button (outside the grid) where the user can pick a single name and press ‘Search’. The Search button changes the .SelectMethod to GetNameByID, returns the list, and binds the short filtered list to the Gridview. This works great too, as the GridView only has 1 record in it.

Now the issue, when I press the Edit button on this GridView to go into edit mode on the single record showing, the Object Data Source appears to be refetching ALL records from the default GetALLNames method via the cache (I have EnableCaching="True" on the ODS) . The result? The GridView does indeed go into edit mode, but for the 1st record out of the 100 original, and not into edit mode on the single filtered record.

Is there a way to prevent the ODS from refetching from that default list from the Cache or from calling the original GetALLNames method, and instead just go into Edit mode on the single record?

Thanks!

  • 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-06-08T11:59:53+00:00Added an answer on June 8, 2026 at 11:59 am

    A similar problem had me stumped for a while. What finally clicked the light on for me was this statement:

    The ObjectDataSource control creates and destroys an instance of the
    class for each method call; it does not hold the object in memory for
    the lifetime of the Web request.

    In my case, the ODS object was relying on a property being set before the select method was called (i.e. ODS.partNumber="123" followed by ODS.getPart).

    To get the ODS to function correctly, I had to populate the object’s required properties in the associated GridView’s _RowEditing, _RowUpdating, and _RowCancellingEdit handlers. That way, when the ODS object was rebuilt upon clicking any of those buttons in the GridView, all of the required properties were set.

    It might not apply exactly in the same way in your case, but it could be related.

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

Sidebar

Related Questions

I know that NSDate does not represent a timezone, but perhaps someone can advise
I have a problem that someone introduced a bug but I do not know
I know that this sort of question has been asked here before, but still
I know that there are a few questions like this on SOF, but I
I know that Watir supports Firefox and Chrome. Does someone know which versions of
Does someone know of a Sqlite manager that I can put on my site,
Could someone know where is saved path to external XML-File that contain configuration for
I know that Phonegap has an event for back button, but it's only available
So, to start off, I want to point out that I know that these
Does anyone know how to make this code stop the knob from rotating past

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.