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
8
votes
2 answers

Keeping a DataGridView autosorted

I've got a DataGridView that is backed by a SortableBindingList as described by this article. This is essentially a BindingList whose Data source is a list of custom objects. The underlying custom objects are updated programatically. My…
chollida
  • 7,834
  • 11
  • 55
  • 85
8
votes
3 answers

"BindingSource cannot be its own data source" - error when trying to reset the binding source from a method in another class

We are binding a DataGridview using BindingSource. So in the main thread we have given like this. class1BindingSource = new BindingSource(); class1BindingSource.DataSource = class1List; …
7
votes
6 answers

Winforms DataBind to Control's Visible Property

Are there any known issues when databinding to a control's visible property? The control is always NOT visible regardless of what my property is. Public ReadOnly Property IsRibbonCategory() As Boolean Get Return True End Get End…
B Z
  • 9,363
  • 16
  • 67
  • 91
7
votes
1 answer

Why do I need to change the Binding Source Position before I can SaveChanges

I have a small demo WinForms app. One of the Forms is my Add New Person form. I used the Details View instead of the DataGridView from my Data Sources. When I enter data and click the save button on the Navigator there are zero changes, However I…
Randy
  • 1,137
  • 16
  • 49
7
votes
2 answers

How can I set a BindingSource current record to null?

I have a capture form for a Works Order, and it has a CustomerBindingSource and a WorksOrderBindingSource control. Most edit fields are bound to the WorksOrderBindingSource, with a ComboBox whose list is bound to the CustomerBindingSource, and its…
ProfK
  • 49,207
  • 121
  • 399
  • 775
7
votes
3 answers

How to move by code the BindingSource to a specific record

Using datagridview bound to BindingSource control bound to a LINQ to SQL class, I wonder how to position the bindingSource to a specific record, that is, when I type a Product name in a textbox, the bindingsource should move to that specific…
Sami-L
  • 5,553
  • 18
  • 59
  • 87
6
votes
2 answers

InvalidOperationException on Databinding when removing last item in list

I'm getting the following message when I try to remove the last item in a datagridview. DataBinding cannot find a row in the list that is suitable for all bindings. I have my binding setup as follows. ExtendedBindingList bl = new…
Justin Drury
  • 748
  • 11
  • 19
6
votes
1 answer

Why DataBinding doesn't work on second time around?

The error I got when I change the datasource of BindingSource "databinding cannot find a row that is suitable for all bindings row that is suitable for all bindings" this.RemoveAllBindings(); // My work-around for the meantime …
Hao
  • 8,047
  • 18
  • 63
  • 92
6
votes
4 answers

unbinding bindingsource

I am using a bindingsource in my windows forms application to populate some textboxes etc in my view. Binding works OK but how can I unsubscribe my bindingSource from from my object? bindingSource.DataSource = new Foo();//OK bindingSource.DataSource…
Gluip
  • 2,917
  • 4
  • 37
  • 46
6
votes
1 answer

C# DataGridView.DataSource difference between using BindingSource and not

I found that I can just set the DataGridView.DataSource directly to the DataTable without using the BindingSource in between, which is what all of the tutorials I've seen so far are using. So what is the difference between these two?
Jake
  • 11,273
  • 21
  • 90
  • 147
6
votes
0 answers

Bindingsource calling controls' value property multiple times?

I have a simple DTO class which I set as the datasource of a bindingsource on a form. The form contains a custom control with a Value property. This is the property: [Browsable(false)] [Bindable(BindableSupport.Yes, BindingDirection.TwoWay)] public…
Ivan-Mark Debono
  • 15,500
  • 29
  • 132
  • 263
6
votes
3 answers

BindingSource.Find throws NotSupportedException (DataSource is BindingList)

I've got a BindingSource with a BindingList attached as the data source. I'd like to work with the BindingSource's Find method to look up an element. However, a NotSupportedException is thrown when I do the following, even though my data source…
Matthias Meid
  • 12,455
  • 7
  • 45
  • 79
5
votes
2 answers

How to sort a DataGridView column (tied to a BindingSource) by date?

I've got a DataGridView which, amongst others, has columns containing dates. Unfortunately, the dates are in the format DD.MM.YYYY and the whole value is in 1 column, which is the common date format here in Europe. The DGV is tied to a BindingSource…
Yuk
  • 101
  • 1
  • 3
  • 7
5
votes
5 answers

.NET BindingSource.Filter with regular expressions

i am using a BindingSource.Filter to list only certain elements of the datasource. especially i use it like this a lot: m_bindingSourceTAnimation.Filter = "Name LIKE '" + FilterText + "'"; now my question is, if it is somehow possible to use…
clamp
  • 33,000
  • 75
  • 203
  • 299
5
votes
1 answer

C# / .NET: Move to desired Item in BindingNavigator

I'm using such a BindingNavigator to let the User move through Data Records of a BindingSource. How can I change the displayed page to a desired page number through the program? I already set the PositionItem to the desired page number, but that…
OneWorld
  • 17,512
  • 21
  • 86
  • 136
1
2
3
45 46