Remote duplicates from bound combobox
Remote duplicates from bound combobox
Remote duplicates from bound combobox
Remote duplicates from bound combobox
Remote duplicates from bound combobox
Remote duplicates from bound combobox Remote duplicates from bound combobox Remote duplicates from bound combobox Remote duplicates from bound combobox Remote duplicates from bound combobox Remote duplicates from bound combobox Remote duplicates from bound combobox Remote duplicates from bound combobox
Remote duplicates from bound combobox Remote duplicates from bound combobox
Remote duplicates from bound combobox
Go Back  Xtreme Visual Basic Talk > > > Remote duplicates from bound combobox


Reply
 
Thread Tools Display Modes
  #1  
Old 02-16-2012, 06:40 AM
madlan madlan is offline
Regular
 
Join Date: Oct 2004
Posts: 74
Default Remote duplicates from bound combobox


Hi all,

I've got a combo box that's bound to a virtualpathbinding source. The column it's bound to (Display and value members) have duplicates that I'm trying to hide/remove.

I cannot remove the duplicates programatically as it errors (the control is bound, cannot change data). Is there a method to do this that I'm missing?

Thanks
madlan
Reply With Quote
  #2  
Old 02-16-2012, 06:49 AM
DrPunk's Avatar
DrPunkRemote duplicates from bound combobox DrPunk is offline
Senior Contributor

* Expert *
 
Join Date: Apr 2003
Location: Never where I want to be
Posts: 1,403
Default

Either sort out the source that it's bound to to not return duplicates or unbind the combobox and add the stuff yourself from the source, not adding items that are already added.
__________________
There are no computers in heaven!
Reply With Quote
  #3  
Old 02-23-2012, 07:58 PM
CharlieMay's Avatar
CharlieMay CharlieMay is offline
Regular
 
Join Date: Sep 2009
Location: Indiana
Posts: 89
Default

Can you show the Query you're using to populate the data for the combobox?
__________________
I thought I knew what I was doing...
...And then I turned on Option Strict
Reply With Quote
  #4  
Old 03-01-2012, 12:28 PM
madlan madlan is offline
Regular
 
Join Date: Oct 2004
Posts: 74
Default

The problem I have is the data structure (this is an external db so can't change it)
The combo box shows the list of groups, with the index available as the ValueMember for filtering in the SelectedIndexChanged event of the Combobox.
The DataGridView and Combo box are bound to different tables, the DataGridView has a column with a comma separated list of values that correspond to the table that the combo box is bound to.

Table that Combo is bound to:

path_index group

1 users1
2 users1
3 users2
4 users2
5 users3
6 users3


Table that DGV is bound to:

Customer path_indexes
Mr A 1,2
Mr B 1,3,4
Mr C 1,4
Mr D 1,2,3,4,5

So selecting users1 in the combo will filter the DGV and only show customers who’s path_indexes contain the relevent values.
I want the combo to show only unique groups, but provide both relevant path_index values.


Code:
Query (Via designer)
SELECT DISTINCT ad_group, virtual_path_index FROM virtual_path_table

        Me.InstallDropDown.DisplayMember = "group"
        Me.InstallDropDown.ValueMember = "path_index"
        Me.InstallDropDown.DataSource = Me.Ftpd_user_dbDataSet.path_table

Private Sub InstallDropDown _SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles InstallDropDown.SelectedIndexChanged
        If InstallDropDown.SelectedIndex <> -1 Then
            DGVCustomers.DataSource.DefaultView.RowFilter = " path_indexes like '%" + InstallDropDown.SelectedValue.ToString + "%'"
        End If
End Sub
In summary, the combobox needs to contain two ValueMember’s for each item listed and this needs to be used in the above event to filter (numerical CSV column) the DataGridView (which is bound to another table)
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
Remote duplicates from bound combobox
Remote duplicates from bound combobox
Remote duplicates from bound combobox Remote duplicates from bound combobox
Remote duplicates from bound combobox
Remote duplicates from bound combobox
Remote duplicates from bound combobox Remote duplicates from bound combobox Remote duplicates from bound combobox Remote duplicates from bound combobox Remote duplicates from bound combobox Remote duplicates from bound combobox Remote duplicates from bound combobox
Remote duplicates from bound combobox
Remote duplicates from bound combobox
 
Remote duplicates from bound combobox
Remote duplicates from bound combobox
 
-->