CombBox with Search Bar

Answered
3
1

Hi everyone, is there any way to have a ComboBox with SearchBar just like the on i uploaded?

The search bar will search for what you typed according to what you have in your items of the combobox.

Thanks everyone!

 

 

Attachment
  • You must to post comments
Best Answer
2
0

Hi Ruben,

I send you a sample on attachment. It’ll show you how to create the component that you need.

For more you can check our professional services : https://wisej.com/services-packages/

Kind regards,

Kevin(ITG)

 

  • ruben ribeiro
    You helped a lot, it solved my problem and it’s working perfectly fine, thanks kevin!
  • ruben ribeiro
    You could implement this as a usercontrol in future WiseJ versions, it’s so good.
  • You must to post comments
0
0

I am trying to apply search function to data bound (with binding source defined) SearchComboBox.

In the code I can see that it is fetching data items:

protected override ObjectCollection CreateItemCollection()

{

    return this.InnerComboBox.Items;

}

but when combo is opened I can only see Sytem.Data.DataRowView items in the list.

When clicking on the item it is correctly assigned to combo box when it is closed.

I tried defining DisplayMember and ValueMember when combo is created but no luck:

var innerComboBox = new ComboBox

{

    Name = “list”,

    Height = 300,

    DropDownStyle = ComboBoxStyle.Simple,

    AutoCompleteMode = AutoCompleteMode.Filter,

    DisplayMember = this.DisplayMember,

    ValueMember = this.ValueMember

};

 

 

  • Julie (ITG)
    What is the issue- what do you mean by “I can only see Sytem.Data.DataRowView items in the list”? Is it not loading the items from the data source? Can you please attach a sample project?
  • You must to post comments
0
0

My take on this would be to set AutoCompleteMode to AppendFilter and add a InitScript to have the filtering.

Cheers, Gerhard

 

 

 

  • You must to post comments
1
0

Thanks Kizaemon,

with your detailed description I could reproduce it.
We´ll fix that issue and I´ll let you know when it passed QA and is included in a next Wisej.NET release.

Best regards
Frank

  • You must to post comments
0
0

Screen recording of steps to reproduce.

 

1) Bind collection A (with 3 items)

2) Select the third item (Antigua)

3) Bind collection B (with 2 items)

4) Select the first item (Zambia)

  • You must to post comments
0
0

Hi Kizaemon,

thanks for following up on this.
I have tried your test case with our latest internal build and could not reproduce it.

Can you please tell me which Wisej version you are using that shows the issue you described?

Thanks in advance!

Best regards
Frank

  • Kizaemon Date
    Hi Frank, the Wisej version is 3.1.2 with dotnet version 4.8.03761. I added a screen recording (webm in zip) to demonstrate the steps. 1) Bind collection A (with 3 items) 2) Select the third item (Antigua) 3) Bind collection B (with 2 items) 4) Select the first item (Zambia)
  • You must to post comments
0
0

Hi Kevin,

 

thank you for the example of UserComboBox usage.

It is working well if the CB is filled using both Items.Add method and DataSource property.

 

When re-binding the CB to a different list, the Items.Clear/Add methods are working well.

But the WiseJ Framework throws an exception when re-binding to a different collection using the DataSource property, containing less elements that the previous one.

 

I attached a sample project to reproduce.

Steps to reproduce:

  1. Bind using the DataSource property to a collection with 3 elements.
  2. Re-bind  using the DataSource property to a collection with 2 elements.
  3. Try to select from the list
  4. Index-out-of range exception is thrown.

 

Kizaemon

 

 

 

  • Kizaemon Date
    Hi Kevin, answering my own question. As a crude work-around, setting the DataSource to null and SelectedIndex to -1 before binding to a new DataSource seem to suppress the crash. public override object DataSource { get { return base.DataSource; } set { if (base.DataSource != value) { base.DataSource = null; base.SelectedIndex = -1; base.DataSource = value; } } }
  • You must to post comments
0
0

Hi Ruben

For the moment this feature isn’t available

Wisej.Net support the filter mode in AutoCompleteMode.

The search bar is different.
Development team is actually been working on it and be available soon

As workaround for now it can be implemented using a UserComboBox
and panel in the drop down with textbox and listbox, etc.

Regards

  • ruben ribeiro
    And how do i give a TEXT to the usercombobox1 as soon as i select something?
  • ruben ribeiro
    example i select a label with the text: “Y” and i want to usercombobox to close and shows “Y” in the usercombobox . just like a combobox when u select smth u can still see what u selected.
  • ruben ribeiro
    Also i cant add controls to tuse usercombobox idk why, im tryind: Dim x as new label …. .. usercombobox1.items.add(label) even buttons its not working
  • Luca (ITG)
    You don’t need to add controls, just assign the drop down control. In there you can place whatever you like. It’s a “User”ComboBox, the implementation is up to you.
  • ruben ribeiro
    Sorry sir, could you please send me code example or source example?
Showing 8 results
Your Answer

Please first to submit.