Home Forums WinForms controls Other WinForms controls WinButton drop down not really working?

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #17986 |

    Maybe I misinterpreted the documentation, but the drop down control isn’t shown unless you explicitly set DroppedDown to true or use the OpenDropDown() method when the button is clicked? Seems to me that there is very few situations where one would like to suppress a drop down from showing, if a drop down control has indeed been set.

    As it is now, it seems you have to catch the Click event of the button and use one of the aforementioned procedures to show the drop down control.

    Imported from legacy forums. Posted by macke (had 6465 views)

    Xceed Support
    Member
    Post count: 5658

    Macke,

    Yes, in effect, you must use code and call OpenDropDown() ( or set DroppedDown to true ) to open the dropdown. The reason for this design is that it allows you to manage your dropdown state (closed, shown ) from any event handler (mouse down, click, etc. ). It provides better control, and allows you to modify your dropdown control before it is displayed – quite useful.

    I hope this helps.

    **Post Edited**

    Imported from legacy forums. Posted by Vince [Xceed] (had 426 views)

    User (Old forums)
    Member
    Post count: 23064

    I’ll buy that, even though I can’t think of a case where a DropDownControl shouldn’t be shown upon clicking the button unless something is set so that the dropdown is suppressed.

    But in any case, calling the CloseDropDown() method or even setting DroppedDown to true doesn’t close the dropdown. I’ve got a listbox shown as my DropDownControl, and when the SelectedIndex changes in said listbox, the CloseDropDown() method is called. Nothing happens after that call though, the listbox is still being shown. Any help with this would be duly appreciated!

    Imported from legacy forums. Posted by macke (had 299 views)

    Xceed Support
    Member
    Post count: 5658

    Macke,
    A call to CloseDropDown() method is equivalent to DroppedDown = false and should be closing the dropdown everytime. Internally it hides the form containing the dropdown when it is visible and if dropdown control property is set.

    Imported from legacy forums. Posted by Vince [Xceed] (had 611 views)

    Xceed Support
    Member
    Post count: 5658

    Do you have a code snippet for us to reproduce the problem?

    Imported from legacy forums. Posted by Vince [Xceed] (had 584 views)

    User (Old forums)
    Member
    Post count: 23064

    Sure:

    private void listBoxSelectionChanged(object sender, System.EventArgs e)
    {
    comboBoxSections.DroppedDown = false;
    }

    This is literally all I’m doing. I put a breakpoint on the line to verify the code is executed and it is. However, it seems that nothing happes, the control is still showing. Perhaps there’s some property on the DropDownControl that might be wrongly set?

    Imported from legacy forums. Posted by macke (had 367 views)

    Xceed Support
    Member
    Post count: 5658

    Make sure you set button.AllowDropDownFocus = true.

    I tried these and it worked well :

    private void winButton1_Click(object sender, System.EventArgs e)
    {
    this.winButton1.OpenDropDown();
    }

    private void listBox1_SelectedIndexChanged(object sender, System.EventArgs e)
    {
    this.winButton1.CloseDropDown();
    }

    Imported from legacy forums. Posted by Vince [Xceed] (had 431 views)

    User (Old forums)
    Member
    Post count: 23064

    Oh my god, I am so sorry. I seem to have wasted your time so badly. I’m not trying to close the dropdown on the button, but another control! I’m extremely sorry for having wasted your time so badly, while infact I simply got lost in my own code!

    comboBoxSections should be dropDownButtonSections.

    Again, I’m very very sorry for wasting your time, and I thank you A LOT for the time you shared! I’m ashamed.

    Imported from legacy forums. Posted by macke (had 315 views)

    Xceed Support
    Member
    Post count: 5658

    No problem, let us know how your project goes 🙂

    Imported from legacy forums. Posted by Vince [Xceed] (had 404 views)

    User (Old forums)
    Member
    Post count: 23064

    I could at least offer a tidbit that might remedy my insanely stupid mistake just a wee bit. I’ve up until now used controls written by Infragistics (I would write my own if time and budget permitted, but you know…) but recently decided that you guys makes controls that are way better than theirs. Not bloated, they’re fast (fast enough at least ;o)) and easy to work with. Your grid is hands down the best grid availible.

    Keep up the great work!

    Imported from legacy forums. Posted by macke (had 7129 views)

Viewing 10 posts - 1 through 10 (of 10 total)
  • You must be logged in to reply to this topic.