Binding data to a control within user control in VB 2013 - vb.net

I have designed a user control in Visual Studio 2013 (VB) . The control contains three Combobox controls through which user can select different values. I bind each combobox to a specific table field in my database (SQL Server) through assigning each combobox's properties [DataSourse, DisplayMember, and ValueMember] the required values. I already created a DataSet.
When I add multiple instances (about 26) of my user-control to a form and run the application, the comboboxes SHOW nothing! as if they are empty. To make sure, I added a Combobox control on the form itself (where user-control instances added), and bind it the same way above, and .. mmm it works!
I'm not able to explain the reason behind this strange behaviour.
I appreciate any assistance.

Related

combobox automatically populated with same value for all bound records

I created a Windows form (DateRowView) where all form fields are bound to an underlying database table (MS Access). When I navigate to the next record, one form field in particular (combobox) automatically populates with the previous record's value. This happens when the underlying database field is empty. If the underlying field contains a value, the proper value displays. No other form fields (textbox, checkbox, date) exhibit this behavior. The underlying table values are correct; it's just what is displayed on the form that is incorrect. This is a VB.NET application, Visual Studio 2019, MS Access 2016. Any help/guidance will be appreciated.
Thanks all for your responses. After much troubleshooting, I stumbled upon the solution. It turns out the combobox 'DropDownStyle' property was the culprit. I had originally set the property to 'DropDownList' to prevent users from entering a value. When I set the property to 'DropDown,' the problem went away. I have no idea why this property would have any effect on record navigation, but it does.

Filtering DataGridView using Comboboxes

Let me preface this by saying I am a beginner as far as .net knowledge.
I am developing a windows form application using tabs in VS2012 in vb. I have bound the datagrid through the designer to a sql server binding source which is populating the data. There are multiple columns in the table and these are split between two tabs with a datagrid on each tab. Both data grids have the same binding source just show different columns.
I created a view within the SQL server to pull in the column names. I think what I want to do and not sure if this is possible but have 2 combo boxes that will be used to filter. One of the would be bound to the view by a dataadapter and then the second to the datagrid binding source.
when the user selects the first combobox(columnname) it would then pull from the datagrid for that column and pull in the valid values to filter. It would then filter the datagridview and refresh it.
Then I am trying to remove the filters through the use of a button.
Can someone please help as I don't even know where to start
You can use Dataview in filtering datasources. You can refer to my answer at this question

vb.net combobox data changes

I am making my final year VB.NET project, I am using Visual Studio 2008 with 3.5 framework
I am making a Restaurant Bill generation software.
I have created the table in SQL and connected to the project, I added 6 combo boxes with drop down,
I have assigned drop-downs as the Menu item of the restaurant, when I run the program and try to change one combo box item, all combo box items get changed. How can I avoid this?
How to get rid of this?
I am not a professional in this, but any help will be appreciated
I would guess that you've bound them all to exactly the same BindingSource (which is pointing at the same data), in which case changing the selection in one combobox will immediately be reflected in the others. If you have multiple items bound to the same BindingSource (which is what the wizard will give you if you're not careful), and don't want a change in one to reflect in the others, you need to create separate BindingSources for each one.

Adding several datasource on same column in DataGridView

I'm working on VB .NET 2008.
Target: Bind dynamic datasource in a cell of a Windows.Forms.DataGridView depending on the selection in previous column. The grid must have 7 columns. If the selection on comboboxcolumn 2 or 4 is done, the datasource of comboboxcolumns 3 and 5 mus change using a query with previous selection as parameter.
In a first try to develop this functionality i've tried to use Telerik.WinControls.UI.RadGridView control. I've created a customized celltemplate with a combobox in order to have different datasource for each cell on the same column. All worked fine but seems to be some kind of bug in RadGridView, because when the combobox is presenting the list, after selection the list continued showing, doesn't dissapears as expected.
Ok, after several days of fight with RadGridView, I give up, and I tried to use same strategy but using Windows.Forms.DataGridView. I've created two classes one inherited from DataGridViewComboboxCell and other from ComboBoxColumn, in order to insert my own combbox or have the chance to have access directly to the combobox values. But the combobox showed is the default combobox not my own combobox.
Anyone knows how can I create a custom comboboxcell but using my own combo, and having access from outside to this combo?
Thanks in advance.
Regards.
You might be overwhelming the abilities of your controls. You can always break them out into parent/child or master/detail grids instead of keeping them combined into one.

Databinding a list (in an object) to a combobox in VB.net

VB 2008 .NET 3.5
I have a custom "Shipment" object that contains a list of "ShippingRate" objects. This list of "ShippingRates" is accessible through a property "Shipment.PossibleShippingRates." That property simply returns a copy of the list of "ShippingRate" for that particular Shipment.
My UI layer receives a list of "Shipment" objects from the BLL. This list is databound to a datagridview, and shows details relevant to the Shipment such as Shipping Address, etc.
I want to bind the "Shipment.PossibleShippingRates" property to a combobox, such that when the user changes the grid row, the combobox reflects the "PossibleShippingRates" for that "Shipment."
In addition, I need a way to store the "ShippingRate" they selected from the combobox for later use.
I have tried a few ideas, but none of them work properly. Any ideas on how to do this?
Wouldn't the simplest solution be to tie a TextChanged or SelectedIndexChanged event to any/all fields in the datagrid that need to trigger a refresh of the combobox?