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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T20:14:48+00:00 2026-05-18T20:14:48+00:00

Some quick background on what I’m working on: I’ve got a page with a

  • 0

Some quick background on what I’m working on:

  • I’ve got a page with a RadGrid tied to an ObjectDataSource that returns a collection of objects
  • On that page; I also have two lists; one contains Ids of objects that need to merged with the collection returned from the ObjectDataSource, and the other contains Ids of objects that need to be removed from that collection
  • The current process for handling this is very hack-ish; when an item is added to either one of those two lists; a separate method is called which dumps the results of myDataSource.Select() into a variable, and performs the manipulation. The grid then has its DataSourceId cleared, and the collection is assigned to the DataSource property, and then DataBind is called. (essentially untying the ObjectDataSource and using manual databinding instead)

My question is as follows: Is it possible to somehow “intercept” the collection returned from the ObjectDataSource so I can manipulate the collection before it is passed to the RadGrid?

If this isn’t possible; it’s not a dealbreaker. I believe I can modify the Select() method to accept the two lists; and perform the manipulation there. Another avenue I have is to implement the NeedDataSource() event for the grid, and manipulate there as well.

Ideally, I’d like to use the first option. Has anybody been successful doing this before?

  • 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-18T20:14:49+00:00Added an answer on May 18, 2026 at 8:14 pm

    You can derive from ObjectDataSource & ObjectDataSourceView, and respectively override GetView & ExecuteSelect, something like this:

    public class MyObjectDataSource : ObjectDataSource
    {
        private MyObjectDataSourceView _view;
        private MyObjectDataSourceView GetView()
        {
            if (_view == null)
            {
                _view = new MyObjectDataSourceView(this, "DefaultView", Context);
                if (IsTrackingViewState)
                {
                    ((IStateManager)_view).TrackViewState();
                }
            }
            return _view;
        }
    
        protected override DataSourceView GetView(string viewName)
        {
            return GetView();
        }
    }
    
    public class MyObjectDataSourceView : ObjectDataSourceView
    {
        public MyObjectDataSourceView(MyObjectDataSource owner, string name, HttpContext context)
            : base(owner, name, context)
        {
        }
    
        protected override IEnumerable ExecuteSelect(DataSourceSelectArguments arguments)
        {
            IEnumerable dataSource = base.ExecuteSelect(arguments);
            // TODO: do your stuff here
            return dataSource;
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Some quick background on what I'm working on: I've got a page with a
Here's the quick background: I've got a client and a server program that are
Quick background I have a concurrent map I used to cache some values that
this is my first question on stack overflow. Some quick background, this is not
Just need some quick clarification I have 2 Queries in my Access Database that
I really need some quick tips here. I've got this VBScript script which sends
I've just got a quick question that if you have time would be great
I have a quick edit jquery dialog that allows my users to change some
Background In Java, I want to make a simple, quick console app that provides
I need a quick solution to getting some decent layout working within the tabnav

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.