VS 2008 Databinding Combobox With Distinct 'Category' Items Only?
Apr 19, 2011
I got a combobox that I populate with items by using databinding options which works fine, but what if I only want to only select the distinct items, was trying to do that but no avail so far. if I could do that just by using an sqladapter in code but is that what I should really do ?
View 2 Replies
ADVERTISEMENT
May 12, 2010
I'm rewriting a VB6 application in VB.Net. So far I have 2 forms, frmLocations (frm1) and frmLocationInfo (frm2). frmLocations has a combobox, cboLocations, from which a selection is made and an "Ok" button is clicked, which then loads frmLocationInfo. frmLocationInfo has a series of textboxes to display info corresponding to the location that was selected - Location, Location Number, Phone, Fax, Email. There are also 3 comboboxes on frmLocationInfo - cboDepot, cboFreight, and cboDispatcher. I need their text property along with items to be populated, also with data corresponding to the initial selection made on frmLocations. I'll spare you all the difficulties I'm having w/the other comboboxes, and instead focus on cboDepot. I have gotten it to populate its text property to display the corresponding Depot, however, the items are not populating and all you see now when you click on the dropdown arrow is only the depot that shows up in the text property.
Here is the code for this portion.
frmLocationInfo
Private Sub FillDepotCombo()
Dim sql As String = "Select distinct depot.depot_name, depot.depot_refnbr, locations.site from depot inner join locations on depot.depot_refnbr =
[Code]....
View 8 Replies
Apr 3, 2009
I'm running into a little problem making one combo box dependent on the selection of another combo box. I'm using a access back-end to this project. I have two tables: MajorCategoryTbl and MinorCategoryTbl , MajorCategoryTbl has PK and description field, MinorCategoryTbl has a PK, MajorID (foreign key), and description field. I have two combo boxes on my form, one that displays the Major description, and one that displays the MinorCategoryTbl description, but the stored value is the PK for both. I want the selection of the minor category combobox to depend on what was selected in the major category combobox.
View 2 Replies
Jun 5, 2010
I have set up a class to hold song information - artist, title. I then created another class that containg a BindingList(of clsSong). I use this binding list to create a data object that can be used to create an RDLC report. This all works. Now I am trying to remove duplicates from the binding list so they don't show up twice on the report. I can't figure out how to get a distinct list for my report. [code]...
View 3 Replies
Feb 7, 2012
On to my question.I have a List(of String) that contains multiple items in each index.
A list declared as:
Dim NewStrings As New List(Of String)
May contain the following:
item (0) - (1 MKNO ABC 2.45 STND 3.3)
item (1) - (1 MKGO ABC 1.34 STND 2.5)
item (2) - (1 MKNO ABC 2.45 STND 3.3)
item (3) - (1 MKNO ABC 2.45 STND 3.3)
[Code]...
View 3 Replies
Dec 27, 2011
I have a combox and a datagridview on a form, the combox filters the datagridview but doesnt have Distinct values. I found this on one of your post. I have a Products DB Table with ProductID, Series, Description and UnitPrice, I am trying to filter the the datagrid using the column Series with the combobox but i get multiple values of the same thing in the combobox, where i would like to make it Distinct.[code]
View 6 Replies
Jun 22, 2009
I'm trying to bind CheckedListbox's Cheched items to Combobox my code is given below
Private Sub chklColumns_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles chklColumns.SelectedIndexChanged
cmbSort.DataSource = chklColumns.CheckedItems
End Sub
whenever I check an item first time it loads one item to the Combobox, but when I select second item still I have single item in the Combo...
View 1 Replies
Apr 19, 2009
Let's say I have a menustrip, which has a category "Colors" for example, and in that category there is an option of 20 colors, but I want only 1 to be checked at any one time, now to do that with what I know, I'd have to check every other one of the check boxes and uncheck them in every single click event, is there no cleaner way to do this?
View 5 Replies
Mar 6, 2012
I want to display distinct items from a column in a checked list box then make a selection or selections and perform commands based on info from a second column in that database the database is a small Access 2010 database in the application directory right now I added the data source and items dont display even though I selected that source in the checked list box properties
Dataset = MyDataSet1
CheckedListBox = MyListBox1
I tried it with a combo box and it shows items but includes duplicates, did I setup the datasource wrong?
View 2 Replies
Feb 27, 2011
I have a Form and I have a DataGridView in this Form. My DataGridView does have a Combobox Column, when I am trying to Databind this DataGridView into my Datatable, it gives me an error: DataGridViewCombobox Cell Value is not valid. I have read all other examples , but I did not get anything because I am new at it.
View 11 Replies
Nov 12, 2009
I'm having an issue with getting the errorprovider to work in a database application where I have put the error provider logic in a partial class and have a combobox value change.Either I set the bindings so that it works but any navigation in the binding navigator then updates the value of that combobox on every next previous etc or it never fires until the save. So there is no way to change the errorprovider setcolumnerror string to something new with out saving on every navigation move. After changing the selection in the combobox the row does shows dirty (rowstatus) so there is databinding but it doesn't fire the ColumnChanged event like textbox and other controls. Is there a way to keep all this in the business logic in a partial class?
Partial Class reportexecDataSet
Partial Class fuellogDataTable
Private Sub fuellogDataTable_ColumnChanged(ByVal sender As Object, ByVal e As
[code].....
View 1 Replies
Apr 7, 2009
I decided to iterate through the Data.DataTable and trimmed the values there.Utilizing SirDemon's post, I have updated the code a little bit:
[code]...
I know that on the DisplayMember line the .First.Item() part is wrong, I just wanted to show what row I am trying to designate as the DisplayMember.
View 3 Replies
Mar 16, 2010
I have a ProbationComboBox with the SelectedValue bound to a RegistrationBindingSource, and the DisplayMember bound to a ProbationBindingSource. [code]
View 2 Replies
Aug 8, 2011
I'm creating a composite user control and trying to exposing the controls as properties so that I can databind them from the form that I drop the user control onto. One of the controls I'm trying to expose is a combobox and I can't seem to figure out how to expose this combobox to the designer. I'm trying the following code that I've cobbled together from what bits of documentation I can find but so far no joy.
<Category("Data"), Bindable(True), _
Browsable(True), EditorBrowsable(EditorBrowsableState.Always), _
DesignerSerializationVisibility(DesignerSerializationVisibility.Visible), _
AttributeProvider(GetType(IListSource))> _
Public Property RollbackCombo As ComboBox
[Code] .....
View 1 Replies
Oct 7, 2009
What wrong with my databinding? How to correct the perfect binding with combobox and texbox.. When I select Projectname the other are changing except the email... Why the email is not changing?
Code:
commemails = New OleDbCommand
daemails = New OleDbDataAdapter
dsemails = New DataSet
dtemails = New DataTable
myconn = New OleDbConnection(("Provider=Microsoft.Jet.OLEDB.4.0;" & "Data Source=") + My.Application.Info.DirectoryPath & "SMRPsource.mdb")
[Code] .....
View 19 Replies
Jan 11, 2010
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.
View 1 Replies
Apr 27, 2010
I have a form, frm1 w/a combobox, cboLocations, which is being populated using a sql string. There is also a frm2 w/a series of textboxes and other comboboxes. I want it so that once a selection is made from cboLocations, the textboxes and comboboxes on frm 2 are populated with the corresponding data. Here is what I have so far:
frm1:
Public Class frmLocations
Dim conn As New SqlConnection("Data Source=f03d3s-dev01; Initial Catalog=dos_track;User Id=vbuser; Password=tran3;")
Dim depot_refnbr As Integer
Private Sub frmLocation_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
conn.Open()
[Code] .....
What's happening right now is that I make a selection from cboLocations on frm1 and click on the OK button, frm2 loads, but none of the textboxes are populating and one of the comboboxes, cboDepot, shows the different data when you click on the down arrow, but it's not displaying anything it its text field when frm2 loads.
View 14 Replies
Mar 29, 2010
I have the following code that populates a combobox:
With Me.ClassSelector
.DataSource = DataAccess.Utilities.ReferenceDataUtils.GetLookupTableData("Category_code_classes")
.DisplayMember = "Category_text"
.ValueMember = "category_class"
End With
However, the SelectedValueChanged event fires once when I set the datasource and again when I set the valuemember. In both instances there is a selected value, although that value was not selected by any user action, but rather because of the loading of the combo box.I don't think there's a 'SurpressEventFiring' property for the combobox, so how to you check to see if the change in the selection was a result of user action and not data loading?Perhaps I'm populating my combobox wrong?
edit: changed 'displaymember' to 'valuemember'
View 8 Replies
Dec 4, 2009
i have 6 combobox and all of them have the same items. the items are random numbers. the problem is that i want the user to select a number from the first combobox but i dont want him to select the same number from the second one or the third. I hope you can understand what i mean.
View 3 Replies
Apr 27, 2010
how to go about this? I have a form, frm1 w/a combobox, cboLocations, which is being populated using a sql string. There is also a frm2 w/a series of textboxes and other comboboxes. I want it so that once a selection is made from cboLocations, the textboxes and comboboxes on frm 2 are populated with the corresponding data. Here is what I have so far:
frm1:
Public Class frmLocations
Dim conn As New SqlConnection("Data Source=f03d3s-dev01; Initial Catalog=dos_track;User Id=vbuser; Password=tran3;")
Dim depot_refnbr As Integer
[Code]...
What's happening right now is that I make a selection from cboLocations on frm1 and click on the OK button, frm2 loads, but none of the textboxes are populating and one of the comboboxes, cboDepot, shows the different data when you click on the down arrow, but it's not displaying anything it its text field when frm2 loads.
View 4 Replies
Jul 13, 2010
I am trying to distinct on multiple columns and get datarows from datatable. but getting error.
Dim query As IEnumerable(Of DataRow) =
(From row As DataRow In SourceTable.AsEnumerable() _
Select row.Field(Of String)("ColumnName1"),
[Code]....
I want another datatable with distinct row based on given columns from SourceTable.
View 3 Replies
Jun 15, 2009
Well currently I'm needing to store various settings, strings, integers, items, etc, within the program settings. So far this has gone without a snag and is working as planned except for one thing, Comboboxes. I have browsed through the various types of settings I can save to and the closest is a "System.Collection.Specialized.StringCollection", however VB is throwing up an error saying that:
Quote:
Error1Value of type 'System.Windows.Forms.ComboBox.ObjectCollection' cannot be converted to 'System.Collections.Specialized.StringCollection'.C:UsersUserAppDataLocalTemporary ProjectsProjectForm1.vb1234Project
How would I go about saving the items in a Combobox?
View 6 Replies
Dec 14, 2009
Im planing to make a little radio application for my own use,I want a Combobox with list of items and a URLs binded to them.for example i got 3 items in the combobox:
Radio1
Radio2
Radio3
I want it to be like when im choosing the "Radio1" and press my Play button ( AxWindowsMediaPlayer2.Ctlcontrols.play() ), the 1.1.1.1/Radio1.asx will open.
View 3 Replies
Apr 17, 2009
I am using VB.NET 2008. I am using propertygrid and have added a few elements. I have 3-4 categories and wanted to know how can I expand/collapse a particular category thru code. I did find a code on net but it didn't work.
View 10 Replies
Jul 1, 2011
am Working on VB.NET 08 Windows Appl. Present i am Working on the DataGridViewCombobox Column. When i click the Combobox ,Clear the Items Which are having the Combobox and add New Items Manually.
For Example: In the Load Event For each Combobox cells Having a,b,c Items. But When i Click the Combobox cell in the DataGridView the Items (a,b,c) delete and Add new Items X,Y,Z .
How can i delete and add new items when click on the Combobox cell in the DataGridView??
View 2 Replies
Jan 27, 2010
I am using VB.NET together with ADO.NET to create a program. I have set my TableAdapters as needed and bound the correct tables-columns to my comboboxes.My problem though is this:My combobox2 item is bound to a datatable. The table adapter's Fill method (the select command basicaly) includes a public variable in the where clause to fetch the correct results. I ll put some code here to clarify it a bit more.Public Class Frm_inv
[Code]...
View 5 Replies
Apr 28, 2012
I want to get all items from one column of database table to the combobox items.
View 2 Replies
Jun 14, 2011
[Code]...
I'm making a combobox on a form. I want the combobox to have a list of choices from a table in a db. The two columns are a String and a Date. I want the date column to only show the year. I'm hoping I have the code right as it is above, but I'm not positive I've done the whole date thing right.
View 6 Replies
Jan 5, 2012
I have a form in my vb.net application used to take the data about the returned stock. The form contains two comboboxes. One, named combobox5, contains invoice numbers and the other, named combobox3, contains party codes. Both the comboboxes are pre_loaded using sqldataadapter.
Now what i want is to change the party code in combobox3 when the invoice number is changed in combobox5. Elaborating it further, When Stock is issued the party code is stored along with the invoice number to keep track of to which party was the stock issued. Now when stock is returned i want to keep track that which party has returned the stock and i want that the party code should be automatically selected when the invoice number is changed and it should be what is stored in the database against that particular invoice number....
I'm using the following code for doing so:
Private Sub ComboBox5_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles ComboBox5.SelectedIndexChanged
' defines a new connection to the database
Dim con As New SqlConnection("Data Source=TAHA;Initial Catalog=ADT;Integrated Security=True")
[Code].....
View 1 Replies
Feb 3, 2012
i'm creating a simple search application which have a TEXT box and some combo boxes and radio buttons and a search button.radio button names "Videos", "Audios", "Pics" etc..when radiobutton of video is selected, a combobox is appear having options "DailyMotion", "Metacafe" etc I want that when i click "Metecafe" item in combobox of video, an other combo box appear having items Like "Entertainment", "How To", "+18" etc(categories of video search).
if combobox1.SelectedItem = "PAKISTAN" Then
combobox2.Visible = True
End if
if combobox1.SelectedItem = "INDIA" Then
[code]....
View 3 Replies