Custom combobox and listbox interaction

Hello guys,

I have a project where i have a combo box and a list box .

the combo box gets loaded on open and gets all the data from a db.

The idea is once you start to write on the combo to load the list based on what you type like a “LIKE” query and to constantly update the list , then once you selected something to add it to the listbox which gets saved on another table in the db.

Now comes the funny part, Is there a way to be able to select multiple records from the dropdown ? i guess not, is there another way to do this easily , maybe after the list was filtered to be able to let you tick a check box and then to add the checked ones into the listbox.

The second issue, is that in the listbox i have 2 columns, 1st column has the data and second has an icon , once i press on the icon it should delete the line but the problem is that i have to press first on the first column to select the record and then on the second column on the X icon to delete the row.

Can i doit directly without selecting the first column ?

For the combo box part i was thinking to doit like a mix between textfield and listbox as a dropdown list in order to be able to do the functionality, any better ideas ?

As well the data is on a remote machine using mysql server so once i put the filter method in the change or text changed event it will not give headache to the server ? is is better to load fist the data into dictionary and to populate that from there based on the filter ? and if yes how do i select the data into the dictionary based on what it types ?

Sample Project here is the sample project on how it should look the setup. Any other ideas are more than welcomed.

So the idea is to use as less time possible to select some data and to have them in the list box, the current setup has a listbox with a contextual menu that loads the master table but the problem is that once the list becomes to big it`s annoying to scroll in the list to search for the correct data so we try to doit better way .

Thanks

2nd issue… look at CellClick event… this way you can click on either column 1 or 2,

Hello Dave,

What do you mean by that ?

i have in the CellClick event the following code :

[code] If column = 1 Then
dim test As Integer
test = lbatcdMed.ListIndex

lbatcdMed.RemoveRow(lbatcdMed.ListIndex)


Return True

End If[/code]

the problems is if i press on the column 1 without pressing on column 0 first to select the line i get a out of bounds error and the app crashes .

Do i have to change something else here ? or to dismiss that Column = 1 ?

Thanks

Fix it , after the change now it works, thanks

[code] If column = 1 Then

lbatcdMed.Selected(row) = true
lbatcdMed.RemoveRow(lbatcdMed.ListIndex)

Return True

End If[/code]

  If column = 1 and row<lbatcdMed.listcount Then
  lbatcdMed.RemoveRow(row)
    Return True
  End If

hi back, so it seems that using a Container control helps a lot but in the same time it restricts the usage of the other controls in the container.

Is there another way to use a control inside the container but to be outside the container part ? i will need something like combo box but the dropdown with the functionality of the listbox and the size of the contextual menu,

Contextual menu to be able to show a long list of data and list box to be able to select more than one record in one time. 

Thanks in advance.

To have an idea what im looking for i did a simple mockup , excuse my design its not the best but it can show the requirements.

So the idea is that the “Search ListBox” it has to expand up and down and to have the ability to select multiple records, and it shows only when i press the D button or i start to type on the Search Field which acts as a filter.

So far i managed to have the Container control to link all the lists together, to have the filter but so far this list part does not work, should i use other controls in order to have it outside the container control or should it be generated by code on container open , maybe with rect control or something like that but no idea how to doit .

Thanks again.

Hello Dave, after using this custom control for a while we are thinking now to have a web app do the same thing, do you think it’s possible to have the same functionality on web ?

Thanks.

short answer … yes
long answer… I don’t know, as this topic is over 2 years old, and I had nothing to do with the code in the custom control