Looking for recommendation for good , free, feature rich ComboBox to use in asp.net Webform project

pclarke7
pclarke7 used Ask the Experts™
on
Hello
can someone recommend a good ComboBox that I can use in my ASP.NET Webform project. It should be Free and be as feature rich as possible. Currently using AjaxControlToolkit.ComboBox but find that it is very limited. For instance I am unable to programmatically set the Dropdown list to droppedDown or Closed.  

regards
Pat
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Dirk StraussSenior Full Stack Developer
Distinguished Expert 2017

Commented:
Have a look at the combobox from Obout. It has a free and paid version by the looks of it.

Author

Commented:
Hi Dirk,
thanks for the recommendation. It first glance it looks like it has some good features. However I am struggling to get an example working. I have create a very simple web forms project in VS2012 targeting .NET Framework 4.5.1. In the code behind I specify:

            ComboBox item = new ComboBox();
            item.SelectedText = "Test Text 1 ";
            item.SelectedValue = "Test Value 1";
            item.SelectedIndex=0;
            item.Visible = true;

However the ComboBox appears empty. Is there anywhere I can get some working examples of this control ?

Regards
Pat
Senior Full Stack Developer
Distinguished Expert 2017
Commented:
I did the following after reading this article ComboBox: Adding Text and Value to an Item (no Binding Source)


public partial class Form1 : Form
{
    public Form1()
    {
        InitializeComponent();
    }

    private void Form1_Load(object sender, EventArgs e)
    {
        ComboboxItem item1 = new ComboboxItem();
        item1.Text = "Test Text 1";
        item1.Value = "Test Value 1";

        comboBox1.Items.Add(item1);
            
        ComboboxItem item2 = new ComboboxItem();
        item2.Text = "Test Text 2";
        item2.Value = "Test Value 2";

        comboBox1.Items.Add(item2);
        comboBox1.SelectedIndex = 0;
    }
}

public class ComboboxItem
{
    public string Text { get; set; }
    public object Value { get; set; }

    public override string ToString()
    {
        return Text;
    }
}

Open in new window


You will probably want to add the items to the combobox inside a loop instead of creating a ComboboxItem object over and over again. This way you can read the items you want to add from any data store and the code will loop through that collection and add those items to the COmboboxItem object and add it to the comboBox1 control.

I also went and created a class called ComboboxItem. Just makes things interesting. Hope it helps.
PS: I used the standard Visual Studio combobox control.
Dirk StraussSenior Full Stack Developer
Distinguished Expert 2017

Commented:
Only solution provided addresses the issue raised by the author.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial