Click here to Skip to main content
15,894,896 members
Home / Discussions / Visual Basic
   

Visual Basic

 
QuestionReport with Crystal Report Pin
Biplob Singha Shee28-Jul-13 21:42
Biplob Singha Shee28-Jul-13 21:42 
SuggestionRe: Report with Crystal Report Pin
ZurdoDev9-Aug-13 8:01
professionalZurdoDev9-Aug-13 8:01 
QuestionDo I need to implement Dispose() ? Pin
David Mujica26-Jul-13 5:31
David Mujica26-Jul-13 5:31 
AnswerRe: Do I need to implement Dispose() ? Pin
Richard Deeming26-Jul-13 5:41
mveRichard Deeming26-Jul-13 5:41 
GeneralRefactoring my code now Pin
David Mujica26-Jul-13 8:03
David Mujica26-Jul-13 8:03 
QuestionCreate Dynamic Label with Drag and Drop Function Pin
Val Gerald Dela Cruz24-Jul-13 14:53
Val Gerald Dela Cruz24-Jul-13 14:53 
AnswerRe: Create Dynamic Label with Drag and Drop Function Pin
Dave Kreskowiak24-Jul-13 17:07
mveDave Kreskowiak24-Jul-13 17:07 
QuestionThree column autocomplete Combobox in form and datagridview Pin
Biplob Singha Shee23-Jul-13 19:44
Biplob Singha Shee23-Jul-13 19:44 
Hi,

I know my question is a bit old and many people asked about this.
I would like to tell you that, I searched my question in various forums and also google it but I did not find my exact answer.

Somewhere it is written "Multiple column combobox" and somewhere it is written "Autocomplete combobox". But I found nowhere about "Multiple column autocomplete combobox".

-----------------------------
| ARIZONA               | \/ | <-- Autocomplete Combobox (Autocompletemode = Suggest)
---------------------------------------------------------
| ARIZONA		|     	16	|	D16	|
| ALBAMA		|	18	|	A28	| <-- 3 Column Dropdown
| ALASKA		|	12	|	C34	|
---------------------------------------------------------


I just need the above type autocomplete combobox where the data comes from a mysql database table. And how to implement it in datagridview.

I tried it in a combobox.....
VB
Private Sub LoadCombo()
        Dim dcommand As New MySqlCommand
        Dim dadapter As New MySqlDataAdapter
        Dim stdata As New DataTable
        qry = "SELECT * FROM statedetails"
        Try
            OpenConnection()
            dcommand.Connection = conn
            dcommand.CommandText = qry
            dadapter.SelectCommand = dcommand
            dadapter.Fill(stdata)
            
            Dim dbreader As MySqlDataReader = dcommand.ExecuteReader
            While dbreader.Read
                For i = 0 To stdata.Rows.Count - 1
                    cmb.Items.Add(stdata.Rows(i).Item("State"))
                    cmb.Items.Add(stdata.Rows(i).Item("OfficeId"))
                    cmb.Items.Add(stdata.Rows(i).Item("CityId"))
                Next
                cmb.DisplayMember = "State"
                cmb.ValueMember = "StateId"
            End While
            cmb.AutoCompleteMode = AutoCompleteMode.Suggest
            cmb.AutoCompleteSource = AutoCompleteSource.CustomSource
        Catch ex As Exception
            MsgBox(ex.Message)
        Finally
            CloseConnection()
        End Try
    End Sub


but the result is
-----------------------
| ARIZONA        | \/ | <-- Autocomplete Combobox (Autocompletemode = Suggest)
-----------------------
| ARIZONA	|
|16		|
|D16		|
| ALBAMA	|
|18		| <-- 1 Column Dropdown
|A28		|
| ALASKA	|
|12		|
|C34		|
-----------------


.... and autocomplete not happening.

I also want to do that, if I select Arizona, the Datagridview nex t cell will populate data "16" ("OfficeId").

I found the link...
Flat-MultiColumn Combobox with Autocomplete[^]
but this is a bit complex to me.

My question is how should I implement it in a combobox and in datagridview combobox ?

Please help...

modified 24-Jul-13 1:56am.

AnswerRe: Three column autocomplete Combobox in form and datagridview Pin
Eddy Vluggen31-Jul-13 8:59
professionalEddy Vluggen31-Jul-13 8:59 
GeneralRe: Three column autocomplete Combobox in form and datagridview Pin
Biplob Singha Shee1-Aug-13 21:34
Biplob Singha Shee1-Aug-13 21:34 
QuestionHow to pass parameter in reportviewer which is calling .RDLC report Pin
Member 381516522-Jul-13 18:43
Member 381516522-Jul-13 18:43 
AnswerRe: How to pass parameter in reportviewer which is calling .RDLC report Pin
Mycroft Holmes22-Jul-13 19:12
professionalMycroft Holmes22-Jul-13 19:12 
GeneralRe: How to pass parameter in reportviewer which is calling .RDLC report Pin
Member 381516523-Jul-13 7:01
Member 381516523-Jul-13 7:01 
AnswerRe: How to pass parameter in reportviewer which is calling .RDLC report Pin
TnTinMn23-Jul-13 7:34
TnTinMn23-Jul-13 7:34 
QuestionVB6 output Access 2000 report to pdf Pin
Member 981947022-Jul-13 9:53
Member 981947022-Jul-13 9:53 
AnswerRe: VB6 output Access 2000 report to pdf Pin
Mycroft Holmes22-Jul-13 12:48
professionalMycroft Holmes22-Jul-13 12:48 
AnswerRe: VB6 output Access 2000 report to pdf Pin
Dave Kreskowiak22-Jul-13 13:55
mveDave Kreskowiak22-Jul-13 13:55 
Questionvbaproject.bin read Pin
JR21220-Jul-13 3:35
JR21220-Jul-13 3:35 
AnswerRe: vbaproject.bin read Pin
Dave Kreskowiak20-Jul-13 7:08
mveDave Kreskowiak20-Jul-13 7:08 
AnswerRe: vbaproject.bin read Pin
TnTinMn20-Jul-13 11:52
TnTinMn20-Jul-13 11:52 
QuestionHow to find mysql table field is empty ? Pin
Biplob Singha Shee19-Jul-13 22:42
Biplob Singha Shee19-Jul-13 22:42 
AnswerRe: How to find mysql table field is empty ? Pin
Biplob Singha Shee20-Jul-13 0:32
Biplob Singha Shee20-Jul-13 0:32 
QuestionERROR When I Show Openfiledialog.ShowDialog() Pin
Sang Nguyen Minh19-Jul-13 8:44
Sang Nguyen Minh19-Jul-13 8:44 
SuggestionRe: ERROR When I Show Openfiledialog.ShowDialog() Pin
Richard Deeming19-Jul-13 8:59
mveRichard Deeming19-Jul-13 8:59 
AnswerRe: ERROR When I Show Openfiledialog.ShowDialog() Pin
Richard MacCutchan19-Jul-13 22:19
mveRichard MacCutchan19-Jul-13 22:19 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.