Hi
I am getting data to my ultracombo from a webservice.
There are some 50,000 records but we sensibly provide a most recently used subset and dynamically
filter as the user is typing.
If the user does not see the entry they want, we want a mechanism whereby they can reqest more data.
I've tried a few options none of which i cant get working
1. Catch the scroll event and if the scrollbar is at the bottom more data will be requested similar to when you search for images in google and start scrolling down.
this doesnt work because there doesnt seem to be any event to figure this out and SPY++ shows that the WM_VSCROLL event isnt being sent.. Adding a WndProc handler shows the same.
2.Add a fake summary row with a hard coded "Click for more" text and catch the mouse click event.
Again there is no event handler and SPY++ shows no mouse click events are being sent
3. Add a fake row at the end with hard coded "Click for more"
Still no mouse click events so the only (hacky) way I can find is to catch the value changed event and
see if the text is "Click for more" but after that the drop down closes. calling Toggle drop down in that event handler is too early and it closes afterwards.
Also for this solution I would need to merge the multiple columns in this row somehow or do a custom paint over it.
I hope you get what I am tryong to acheive, any nice solution will do.
thanks
Michael
HI
Still on this with some tweaks needed:
1. When there are no records the drop down area of the parent combo is too big so I get grey a rectangle:
I have access to the parent combo in the initappearance, but in any case I don't see a property to allow be to shrink the combo's height.
The Height property only sets the height os the dit portion as opposed to the drop down portion and there is nothing I can find on DisplayLayout.Bands[0].
2. When there are records I would like to change the colour of the white line above the UIelement
so its the same as the grid separators.
Again I have access to the parent combo (as I guess its the bottom border of the drop down), I tried this
parentCombo.Appearance.BorderColor =
Color.Green;
but it seems to create a green rectanlge that doesnt quite fit and also only paints when the mouse is over it.
Hi Michael,
Sorry, I forgot we were talking about UltraCombo and not UltraGrid here. There are no events for scrolling the combo, unfortunately.
Hi Mike
I found a solution of doing a repaint with DirtyChildElements when I'm setting the text but only if the text changed in Initappearance - I see what you mean by setting in there, without the check, CPU quickly pops up to 50%
It works but I think its still a bit of a waste doing the check each time (even though CPU happily sits s 0%) and would like to do it how you suggested but there is no scroll event.
Hi,
It's been a while, so I don't remember everything that you are doing here, exactly. But it sounds like you need to force the CreationFilter to be called at a certain point.
If that is the case, then you need to call DirtyChildElements and/or VerifyChildElements on the element. You have to be very careful about this. You don't want to call either of these methods from within your CreationFilter because that would cause an infinite loop. But perhaps you can use the Before/AfterRowRegionScroll event to detect when you are at the bottom and dirty your button element.
I have used your suggestion for a CreationFilter and like Michael found it works well for us too.
The only issue i have now is i scroll through the combo and when i hit the bottom the BeforeCreateChildElements gets invoked where the parent is a SummaryFooterEleement. this in turn performs the adding of our "get more records" button. Once added it invokes the overriden InitAppearance which sets the text on our button.
My problem is that as I am scrolling the rendering does not happen until i let go of the mouse. So the button has no text and therefore users do not know that the button is present unless they let go of the mouse button. Our users don't have that kind of patience :)
Can you help with how the button can be rendered while scrolling, perhaps invoking a different event?