Questions tagged [bindingsource]

BindingSource is a .NET class that encapsulates the data source of a Windows form.

BindingSource is a .NET class that encapsulates the data source of a Windows form. A rough equivalent in the Java standard API might be RowSet.

682 questions
4
votes
1 answer

BindingSource Refresh

I have 2 classes i.e CustomerOrder and Customer class has a reference to a collection of orders. I use master detail BindingSources. My problem is when I use the lazy load pattern for orders my detail BindingSource is not…
xprt
3
votes
4 answers

How to properly commit bindingSource changes to source DB?

I setup DataGridView and other UI components to allow user to edit data from SQLite DB. But these changes (even they are properly shows in application) doesn't saves to DB. I have tried this…
kseen
  • 359
  • 8
  • 56
  • 104
3
votes
1 answer

How to get the underlying object bound to a control?

Using WinForms and data bindings. I have a form containing a BindingSource component and I have set the DataSource property from the designer to a class: public class MyClass { public string MyString {get;set;} } Now, how do I get the MyClass…
Stécy
  • 11,951
  • 16
  • 64
  • 89
3
votes
2 answers

How to enable on BindingNavigator the AddNewItem

I'm trying to bind the BindingNavigator to a BindingSource. It works very good, but the problem is the yellow plus icon is disabled. How can I make it enabled? I created manually with code the dataset, tableadapters and the bindingsource, but when…
Enrique Benitez
  • 649
  • 2
  • 13
  • 28
3
votes
5 answers

Datagridview error System.IndexOutOfRangeException: Index 0 does not have a value

I am getting one error when I am trying to populate binding source. The exception is as follows; System.IndexOutOfRangeException: Index 0 does not have a value. at System.Windows.Forms.CurrencyManager.get_Item(Int32 index) at…
VJOY
  • 3,752
  • 12
  • 57
  • 90
3
votes
1 answer

Get filtered result from BindingSource to table/dataset?

I'm using a BindingSource connected to a DataGridView to filter the data shown. I would like to know what is the best way to get the filtered result to some other thing than a GridView? I ask this as I would like to use the filtered result for a few…
Jonas Lindahl
  • 752
  • 10
  • 24
3
votes
0 answers

C#: BindingSource CancelEdit for all objects and there child objects from EF

Let's say i have two objects from EF with INotifyPropertyChanged. Object1 has many Object2 and the BindingSource1 has many Object1. If I change some Properties of BindingSource1.Current (Object1) I'm able to restore them by calling…
Wowa
  • 1,791
  • 1
  • 14
  • 24
3
votes
1 answer

Adding new row in correct position to a user sorted wingrid with bindingsource

I have a Infragistics UltraGrid using a bindingSource. If I add a new object to my binding list, it adds a row to the bottom of the grid which is fine if there's no user defined sort. Question is if the user clicks on a column header to sort the…
debugme
  • 1,041
  • 1
  • 10
  • 22
3
votes
0 answers

The type 'System.Void' may not be used as a type argument! Error occurs

I am getting weird error on c# winforms. I summarize the problem step by step. I have 1 model (public class) I have a winform that includes a datagridtable and this is binded to model. Winfom.cs is opened. Close the visual studio and reopen. I am…
3
votes
1 answer

Saving a picture from picturebox to database with bindingsource c#

Sorry if the answer is going to be obvious. I'm busy with a winforms app in c# with a sqlcompact DB. I'm using a dataset, bindingsource, tableadapter, adapter manager, binding navigator. I have been struggling for a day now to save a picture from a…
Vamp_102
  • 83
  • 8
3
votes
2 answers

Empty BindingSource problem

I have a problem with binding data using BindingSource, typed dataset and DataGridView. My problem is: BindingSource, therefore grid, is empty after binding data (bindingSource.Count is 0). I couldn't figure out what I'm doing wrong and I'd be very…
dstr
  • 8,362
  • 12
  • 66
  • 106
3
votes
3 answers

Filter BindingSource with entity framework

Hi How can i filter results exists in BindingSource filled with entities ( using EF 4)? I tried this: mybindingsource.Filter = "cityID = 1" But it seems that binding source with entity framework doesn't support filtering .. am i right ?,is there…
Dabbas
  • 3,112
  • 7
  • 42
  • 75
3
votes
2 answers

Binding to IList, but getting "Complex DataBinding accepts as a data source either an IList or an IListSource"

If you run the following code without debugging (or with "Enable Just My Code" active), it will seem to work. But if you start it with debugger and with "Enable Just My Code" turned off, you will get this exception (which is then swallowed by…
Daniel Wolf
  • 12,855
  • 13
  • 54
  • 80
3
votes
1 answer

How save changes to a database after IBindingSource.AddNew() method is used

I have a form that I use for both editing and inserting new users into a database. I use Entity Framework 6. All my controls (textboxes and one combobox) are bound to specific binding sources so when I update an entity with: context.user.add(user);…
Whirlwind
  • 14,286
  • 11
  • 68
  • 157
3
votes
0 answers

Bindingsource filter using DataGridView and Entity Framework

I'm developing my first Winforms app using Entity Framework to access database. I have experience using dataset and tableadapters. I have a form with a DataGridView (DGV) on it, and I want to filter the displayed data. In previous app, to filter…
Lucas Schorb
  • 31
  • 1
  • 5