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

Get the BindingSource position based on DataTable row

I have a datatable that contains the rows of a database table. This table has a primary key formed by 2 columns. The components are assigned this way: datatable -> bindingsource -> datagridview. What I want is to search a specific row (based on the…
Ronald
  • 41
  • 1
  • 2
4
votes
2 answers

Filter BindingSource when DataSource is a BindingList

I have read from a excel sheet and wrote this for a BindingList, in Form_Load() this is set to a DataSource as BindingSource: bd = new BindingSource(); //instance of BindingSource bd.DataSource = ExcelOPS.LerExcel(); //LerExcel() method return a…
Franklin Januário
  • 125
  • 2
  • 2
  • 7
4
votes
1 answer

Image Databinding to the pictureBox

I have tried to bind the image from the column "Applicant's Image" in the datatable "Applicant's Details" in Data Set "data_set" through two methods. But When I run the Form Application I see no image displayed in the picturebox "imgusr". My binding…
Sagar Maru
  • 65
  • 3
  • 10
4
votes
1 answer

BindingSource as BindingSource vs BindingSource as ViewModel

I've noticed these two ways of implementing databinding in winforms.However, I would like to know which one of them is more preferred (In terms of overall performance e.g design time, efficiency? As far as I know, these two are: BindingSource as…
Lawrence
  • 334
  • 2
  • 12
4
votes
1 answer

Update elements in BindingSource via separate task

I have a class, say Person, with an Id and a name. This class properly implements INotifyPropertyChanged Addition: some people asked for class Person. My real problem is a more elaborate class, I've simplified it to a fairly simple POCO to be…
Harald Coppoolse
  • 28,834
  • 7
  • 67
  • 116
4
votes
3 answers

Can I get the item type from a BindingSource?

I would like to get the Type of item that a BindingSource is hooked up to or configured for. The BindingSource.DataSource property can be set to an object, list, or type. If it is a Type, it obviously does not have a bound item yet, but I would…
4
votes
3 answers

C#: Adding Columns To Bound DatagridView With Code

// Getting data from this Admin class: public static IQueryable GetStudents() { DojoDBDataContext conn = new DojoDBDataContext(); var query = from s in conn.Students join b in conn.Belts on s.BeltID equals b.ID …
mdvaldosta
  • 291
  • 2
  • 6
  • 19
4
votes
4 answers

Strongly-Typed BindingSource Filter

Constructing a BindingSource.Filter string feels like an ugly, manual, forced way of filtering already retrieved data. No explicit type checking No explicit column name checking No explicit SQL syntax checking Requires manual ToString()…
Steven
  • 13,501
  • 27
  • 102
  • 146
4
votes
2 answers

DataBinding of DataGridView and List<> with BindingSource

I'm trying to figure out how data binding with BindingSource is supposed to work I want a DataGridView to be populated with the content of a List<> upon update of the list. I can see the List grow and verify it's being filled when I check the…
rdoubleui
  • 3,554
  • 4
  • 30
  • 51
4
votes
5 answers

Select newly added Row - DataGridView and BindingSource

I'm adding a new Row to a BindingSource that is Bound to a DataGridView source.AddNew(); After this, use BindingSource to get the newly added row is return the next row in the DataGridView when its sorted. ROW "A" ROW "B" <-…
Ruben Trancoso
  • 1,444
  • 5
  • 27
  • 55
4
votes
3 answers

CancelEdit on bindingsource doesn't cancel all edited fields of an object

I have a bindingList that each object of bindinglist implement INotifyPropertyChanged, In my WinForm I used a BindingSource and set datasource of it to BindingList then bind some textbox to properties of each item in BindingList(I use this…
Masoud
  • 8,020
  • 12
  • 62
  • 123
4
votes
1 answer

How can I get my bindingSource to support sorting?

I am trying to make a master-details form, with the master records bound to one binding source, and the details datagridview bound to a second binding source It works pretty well, only the childBindingSource.SupportSorting property is…
Kirsten
  • 15,730
  • 41
  • 179
  • 318
4
votes
3 answers

Binding source filtering

Hope you can help me with this. I'd like to filter my datagridview by using a certain keyword like a name for example. I used a data set then bind it to a data source then to my datagridview for viewing. When I used the bindingsource.filter I…
helios99
  • 91
  • 1
  • 1
  • 7
4
votes
2 answers

use filter of bindingSource with Entity Framework

I working on a C# win-form app. in my form i have Data-Grid-View that bind with a Binding-Source and Binding-Source Data-source is a table of entity-framework. when i use entity framework i cant use filter of the binding-source and the sort by…
Arman
  • 1,019
  • 2
  • 14
  • 33
4
votes
5 answers

DataGridView AllowUserToAddRow property doesn't work

I have a simple project with Entity Framework, I have a DataGridView in my Form and I set its AllowUserToAddRow property to true but still I can not add new rows into it. And here is my code: DBEntities context = new DBEntities(); private void…
Masoud Keshavarz
  • 2,166
  • 9
  • 36
  • 48