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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T07:57:34+00:00 2026-06-11T07:57:34+00:00

I have to forms. First has datagridview with BindingList<CustomObject> as DataSource . Second should

  • 0

I have to forms.

First has datagridview with BindingList<CustomObject> as DataSource.

Second should add/remove/update DataSource from the first form.

How can I do this? Modifying etc is happening in button_Click(object sender, EventArgs e) on secondform. I could pass BindignList<> by ref to SecondForms() constructor, but I can’t pass it further to button_Click()

  • 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-11T07:57:35+00:00Added an answer on June 11, 2026 at 7:57 am

    What you can do is create an event in form2 that form1 will subscribe to. Keeping things sort of separate.
    I don’t know how you have structured Form1 and Form2 so I will just give an example.

    class Form2 : Something
    {
      public event NotifySubscriberEventHandler NotifySubscriberEvent ;
       public void button_Click(object sender, EventArgs e)
       {
          var handler = NotifySubscriberEvent ;
          if( handler != null)
           {
              handler(this,EventArgs.Empty) ;
           } 
    
       } 
    } 
    
    class Form1 
    {
       public BindingList<T> MyBindingList {get;set;} //
       public void CreateForm2()
       {
           Form2 form2 = new Form2() ; 
           form2.NotifySubscriberEvent += OnButtonClicked;
    
       }
       public void OnButtonClicked(object source, EventArgs e)
       {
         //Do Something when notified
          MyBindingList.Add(...)
       }
    }
    

    You will have to create a NotifySubsubscriberEventHandler delegate.
    Here:
    http://www.akadia.com/services/dotnet_delegates_and_events.html#Simple%20Event

    But you already say you are passing BindingList into a constructor I assume like this:

    public class Form2
    {
      private BindingList<T> bindingList ;
      public Form2(BindingList<T> bindingList)
      {
           this.bindingList = bindingList ;
      }
    
       public void button_Click(object sender, EventArgs e)
       {
       // Do     bindingList.Add() or whatever
    
       } 
    }
    

    Does the above not work? ^^

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

Sidebar

Related Questions

I have two forms. The first form Main has 2 buttons and a link
In my application I have a feedback form. The user has to first login
I have a table inside a form. It has two columns, the first one
I have two forms. The first form is the mainForm, this never goes anywhere.
I have 2 forms set up. In the first form I have the following
I have a two forms on a page. The first one has several quantity
I have a form created which an unbound datagridview that has three columns. Position,
I have two forms using a ListView component. In the first form it works
I have a index.jsp file that has two different types of forms <form action=searchpath
I am new in .net.I need help. I have 2 forms one form has

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.