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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T20:52:09+00:00 2026-05-28T20:52:09+00:00

I have created a component to fetch data from a web service. The web

  • 0

I have created a component to fetch data from a web service. The web service returns an ADO.NET dataset.

I would like this component to be a data source for binding with other controls. The data to source would be the dataset.

So, I added a property DataSet to the component.

private DataSet _dataSet;
public DataSet DataSet
{
    get { return _dataSet; }
    set
    {
        if (_dataSet == value)
            return;
        _dataSet = value;
        OnPropertyChanged (this, new PropertyChangedEventArgs ("DataSet"));
    }
}

I implemented IListSource for the component.

public partial class MyComponent : Component, INotifyPropertyChanged, IListSource
{
    ...

    IList IListSource.GetList()
    {
        return DataSet == null ? null : ((IListSource)DataSet).GetList();
    }

    bool IListSource.ContainsListCollection
    {
        get { return DataSet != null && ((IListSource)DataSet).ContainsListCollection; }
    }

    ...
}

In the method where the data is received from the web service I do the following:

...

DataSet = response.DataSet;    // Copy dataset from web service to the component.

...

I then created a new WinForms project with a form. On this form, I added my component and a DataGridView. Setup the binding between them.

Upon running the application, the web service is called and the dataset is received. However, the UI does not show the data.

I even tried to create a dataset in the component’s constructor and instead of replacing the dataset in the DataSet property I merely do

_dataSet.Reset ();
_dataSet.Merge (value);

Still no effect.

Is there an event or method I need to call to have the dataset communicates it was updated?

What am I missing here?

  • 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-28T20:52:10+00:00Added an answer on May 28, 2026 at 8:52 pm

    Yes, there is an event you need! The DataGridView responds by automatically updating its contents against the ListChanged event of the underlying DataSource (which you can raise by implementing IBindingList). IList does not support this event, and without it the DataGridView will not show the newly populated data unless you reassign the DataSource property of the DataGridView to your underyling component each time it changes which you don’t want to do if you will have changes often (it’s expensive).

    I had to learn this painful lesson myself here:
    Updating DGV IList

    Let me know if I’m way off-base here, but this feels like where your problem could be.

    EDIT: An example of how this might work –

      private DataSet _dataSet;
      public DataSet DataSet
      {
         get { return _dataSet; }
         set
         {
            if (_dataSet == value)
               return;
            _dataSet = value;
            ListChanged(this, new ListChangedEventArgs(ListChangedType.Reset, 0));
         }
      }
    
      public event ListChangedEventHandler ListChanged;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created a transformation component, and basically it accepts data from a source,
I have created a composite component in JSF2. I works great. I would like
I have created a reddot cms component, in which I added this line Also,
I'm using Joomla 1.5. I have created a custom component that pulls data out
In the past, I have created a component to pass and retrieve values to/from
Please help me on this problem I have created a component. in the component
I have created a .NET C# component that I am going to sell as
I have created a Custom Event, that is fired from a custom component. It
I have created a component derived from TCustomPanel. On that panel I have a
I have created a custom component (NumberFormattedTextField) of JFormattedTextField. This is the Formatter I

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.