troubleshooting Question

How do i modify a script working and a Generic List to now work with a BindingList

Avatar of Olukayode Oluwole
Olukayode OluwoleFlag for Canada asked on
C#* list generate
2 Comments1 Solution8 ViewsLast Modified:
I have in my c# application a script that worked fine
when i generated my List as a generic List.

Now I have changed the list generation method to a Binding list.
The 2 Bindling List are now defined and works properly

 BindingList<ARCustomerModel> customers = new BindingList<ARCustomerModel>();
 BindingList<ARSalesModel> salesinvoices = new BindingList<ARSalesModel>();

My Script Generating the error is shown below

[code]private void customerNameListBox_SelectedIndexChanged(object sender, EventArgs e)
            LoginDetails.staticentcode = "Quotation";
            ReferenceListProccesor processor4 = new ReferenceListProccesor();
            var newList4 = processor4.CustomerInvoices(LoginDetails.staticcompany, LoginDetails.staticentcode, "public.sparsales_getmasterrec");
            customerInvoicesListBox.DataSource = null;
            customerInvoicesListBox.DataSource = salesinvoices;
            customerInvoicesListBox.DisplayMember = "FullInvoicesList2";
            newList4.ForEach(x => salesinvoices.Add(x));
            var data = (sender as ListBox).SelectedValue as ARCustomerModel;
                if (data != null)
                    customerInvoicesListBox.DataSource = salesinvoices.Where(salesinvoices => data.ARCUSTCustomerID.Equals(salesinvoices.ARSALECustomerID)).ToList();
                    salesinvoices = salesinvoices.OrderBy(x => x.ARSALEExtDocumentNo).ToList();

And my error screen is shown below

How do i modify the script that worked  with a generic list
to now work with a Binding List
Kelvin McDaniel
Independent Consultant

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Log in to continue reading
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform for $9.99/mo
View membership options
Unlock 1 Answer and 2 Comments.
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
See how we're fighting big data
The Value of Experts Exchange in My Daily IT Life

Experts Exchange (EE) has become my company's go-to resource to get answers. I've used EE to make decisions, solve problems and even save customers. OutagesIO has been a challenging project and... Keep reading >>


Owner of Outages.IO
Phoenix, Arizona, United States
Member Since 2016
Join a full scale community that combines the best parts of other tools into one platform.
Unlock 1 Answer and 2 Comments.
View membership options
“All of life is about relationships, and EE has made a virtual community a real community. It lifts everyone's boat.”
William Peck

Member since 2004