Hi,
I have a button with a ListBox control as part of its dropdown content. The content also contains 'ok' and 'cancel' buttons to allow the user to dismiss the dropdown when they are done. I have run into a number of problems trying to get this to work. I don't know whether they are bugs or whether I should be doing this another way so I look forward to any comments that you may post.
Here they are:
1. When a listbox item is selected then the dropdown content closes. This happens because RadGallery.cs registers a handler that unconditionally closes the dropdown when a listbox selection changes. This seems like the right thing to do since there needs to be a way for the dropdown to close but inhis case it is undesirable since I have buttons that serve that function. What I am wondering is if an attached property could be created that could give the handler some direction about whether it should close the dropdown. I would then be able to attach this property to my listbox and the handler would know that it shouldn't close the dropdown.
2. I got around the 'listbox selection closing' problem by setting RadRibbonDropDownButton.KeepOpen = true but this brings on the next issue. 'KeepOpen' appears to work not by preventing the dropdown content from closing but by reopening after its been closed. This isn't obvious when interacting with the control but if you look at the call stack then you'll see that there is a call to 'IsOpen = false' that is quickly followed by a call to 'IsOpen = true'. The side effect of this is that every time a listbox item is selected then the 'DropDownOpening' event is raised. This is undesirable because I have some state variables that I would like to set only when the dropdown content is first displayed. My expectation was that this event would get called only when the drop down was opening and not additionally whenever a listbox item was selected.
3. This one is really more of a question followed by what may be a request. In order for my 'ok' and 'cancel' buttons to close the dropdown programmatically they must determine the RadRibbonDropDownButton control that the dropdown belongs to but I could find no straightforward way to do this other than giving the button a name and then referring to that name in the handlers. What I'd really like to do is to get this to work in a more generic way since my desire is to move the 'ok' and 'cancel' button handlers into a class which I would then use as a base class for other dropdown content. So the question is whether there is a way to do this that I am missing. If there is none then I have a request, which is for the RadRibbonDropDownButton to attach a property to the topmost visual of its dropdown (a popup I suppose) that indicates the RadRibbonDropDownButton that owns the dropdown.
Thanks and best regards,
Pete
I have a button with a ListBox control as part of its dropdown content. The content also contains 'ok' and 'cancel' buttons to allow the user to dismiss the dropdown when they are done. I have run into a number of problems trying to get this to work. I don't know whether they are bugs or whether I should be doing this another way so I look forward to any comments that you may post.
Here they are:
1. When a listbox item is selected then the dropdown content closes. This happens because RadGallery.cs registers a handler that unconditionally closes the dropdown when a listbox selection changes. This seems like the right thing to do since there needs to be a way for the dropdown to close but inhis case it is undesirable since I have buttons that serve that function. What I am wondering is if an attached property could be created that could give the handler some direction about whether it should close the dropdown. I would then be able to attach this property to my listbox and the handler would know that it shouldn't close the dropdown.
2. I got around the 'listbox selection closing' problem by setting RadRibbonDropDownButton.KeepOpen = true but this brings on the next issue. 'KeepOpen' appears to work not by preventing the dropdown content from closing but by reopening after its been closed. This isn't obvious when interacting with the control but if you look at the call stack then you'll see that there is a call to 'IsOpen = false' that is quickly followed by a call to 'IsOpen = true'. The side effect of this is that every time a listbox item is selected then the 'DropDownOpening' event is raised. This is undesirable because I have some state variables that I would like to set only when the dropdown content is first displayed. My expectation was that this event would get called only when the drop down was opening and not additionally whenever a listbox item was selected.
3. This one is really more of a question followed by what may be a request. In order for my 'ok' and 'cancel' buttons to close the dropdown programmatically they must determine the RadRibbonDropDownButton control that the dropdown belongs to but I could find no straightforward way to do this other than giving the button a name and then referring to that name in the handlers. What I'd really like to do is to get this to work in a more generic way since my desire is to move the 'ok' and 'cancel' button handlers into a class which I would then use as a base class for other dropdown content. So the question is whether there is a way to do this that I am missing. If there is none then I have a request, which is for the RadRibbonDropDownButton to attach a property to the topmost visual of its dropdown (a popup I suppose) that indicates the RadRibbonDropDownButton that owns the dropdown.
Thanks and best regards,
Pete