[MonoDevelop] Force ComboBoxEntry DropDownList to show programatically
Aaron Radich
aaron at radich.com
Thu Dec 1 01:06:43 EST 2011
Thanks for the suggestion. I couldn't get it to work, though, as I've
got 1 million search values and therefore I only want to populate the
Completion on the fly, with just the list store values that match what
the user typed into the Entry. The EntryCompletion appears to need to
be populated before the user starts typing into the Entry. So, I'm back
to wanting to use the ComboBox. I've got it working 95%, would just
like to force the DropDown to display once it's populated.
Aaron
On Wed, 2011-11-30 at 20:32 +1300, Daniel Hughes wrote:
> Sorry you append the values to the ListStore the last few lines should
> be
>
>
>
> //append values
> listStore.AppendValues ("one");
> listStore.AppendValues ("two");
> listStore.AppendValues ("three");
>
>
>
>
>
> On Wed, Nov 30, 2011 at 8:28 PM, Daniel Hughes <trampster at gmail.com>
> wrote:
>
> What you want is an Entry widget with the EntryCompletion
> property set. I use this in WideMargin so display a list of
> matching book names as they type in a drop down which they can
> select from. The code is open source and is available here:
>
>
>
> https://bitbucket.org/trampster/widemargin/src/5d4ea179adc1/WideMargin.GUI/SearchPage.cs
>
>
> Basically it's as follows:
>
>
> var listStore = new ListStore (typeof (string));
>
>
> var completion = new EntryCompletion();
> completion.TextColumn = 0;
> completion.Model = listStore;
>
>
> var entry = new Entry();
> entry.Completion = completion;
>
>
> //append values
> completion.AppendValues ("one");
> completion.AppendValues ("two");
> completion.AppendValues ("three");
>
>
> Now as you type it will fill the drop down with the matching
> entries.
>
>
> Cheers,
> Daniel
>
>
>
>
> On Wed, Nov 30, 2011 at 7:53 PM, Aaron Radich
> <aaron at radich.com> wrote:
>
> Is there any way in code to make a ComboBoxEntry force
> it's dropdown to show, as if the user pressed the down
> triangle? I'm trying to simulate an instant search
> scenario where the user types some text into the
> ComboBoxEntry and then in code I populate the dropdown
> list and then make it dropdown so that it's visible.
> Any suggestions would be appreciated.
>
>
>
>
>
>
>
> _______________________________________________
> Monodevelop-list mailing list
> Monodevelop-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/monodevelop-list
>
>
>
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/monodevelop-list/attachments/20111130/c720b708/attachment.html
More information about the Monodevelop-list
mailing list