Working in version 9.2 in .net 2008. Using a ultraweblistBar that I programmatically populate the groups and also the items at runtime. If item list requires scrollbar and an item selected down in the list, the control postbacks to populate a grid but the scrollbar goes back to the top item within the group. Any code or setting to keep the scrollbar position after a postback?
I also set the Hover and SelectedItem settings to show a background color. When an item is selected the background color shows fine but when you hover the mouse over it again the background color disappears and does not go back to the selected color after moving off of the item that was selected. Is this a bug or is there a setting for this?
Thanks
Hi jcom39201,
It should be possible to persist the scrolling position for the selected group in UltraWebListbar using some custom code. Here is my suggestion for implementing this:
function UltraWebListbar1_InitializeListbar(oListbar, oEvent) { var selectedIndex = iglbar_getListbarById("UltraWebListbar1").SelectedGroup.i; document.getElementById("UltraWebListbar1_Items_" + selectedIndex).scrollTop = document.getElementById("HiddenField1").value; } function postbackHandler() { var selectedIndex = iglbar_getListbarById("UltraWebListbar1").SelectedGroup.i; document.getElementById("HiddenField1").value = document.getElementById("UltraWebListbar1_Items_" + selectedIndex ).scrollTop; }
The HiddenField element is placed on the page and its function is to set the scrollTop position after a postback. Please note that in order for this to work when a postback is initiated, the HiddenField's value needs to be updated.
As per your second questions: I tested setting the DefaultItemHover and DefaultItemSelectedStyle's BackColor and it seems to be applied as expected (i.e. mouse hover is not removing the selected color). Attached is my working sample.
Please tell me if this helps.
Best Regards,Petar IvanovDeveloper Support EngineerInfragistics, Inc.http://ko.infragistics.com/support
Petar,
Thanks for the reply!
Not sure I am implementing the scrollbar position correctly. I put the functions on my page, added a hiddenfield to the page and added to the listbar a client side event...
<
ClientSideEvents InitializeListbar="UltraWebListbar1_InitializeListbar"/>
on the ItemClicked event in VB I set the value of the hiddenfield to...
HiddenField1.Value = UltraWebListbar1.SelectedItem.Index.ToString
When I run the page I put a stop on the Function Initializebar and step thru it and after executing the document line it goes to a catch statement that sez...
can't evaluate - UltraWebListbar1_InitializeListbar(oControl);
I don't think I am implementing it correctly though. Am I doing it wrong?
Per the second item I did not see your attachment.
I am still not having any luck. I removed any update panels I had and replaced them with the WebAsync. I tried to put the Clientids of the hiddenfield to static but that setting is not part of the hiddenfield list of commands and it rendered the field as an error. I read that that is part of Asp.net 4.0 and I am only on 3.5. Not sure if that is what is still holding it back from working but I am still getting same results as before. I also have vb code behind the listbar itemclick that runs at server to get data from SQL and populate a grid. Would that be causing any issues? Not sure if I had that still in the example I sent. Thanks for looking into this. This one has been a head scratcher.
Thanks for your reply and your patiance.
I have investigated this further and have created another a little simplified sample using CLR3.5 to illustrate my findings.
Here I am using hidden input fields which I get on the client by their clientIDs and this should work OK now. The Listbar is directly inside an WARP panel (and nothing else is inside that panel) and its RefreshComplete client-side event is used to set the scroller position of the listbar. The listbar's BeforeItemSelected event is used to set the value of the hidden field before postback.
I have placed the WARP with the listbar inside an UltraWebTab and that seems to work well (the ultraWebTab is inside an updatePanel which also seems to operate correctly). In my tests the ItemClicked server-side handler seems to be fired every time in Firefox, IE8 and IE9.
Please tell me if the sample works for you and whether a similar configuration in terms of nesting of elements is applicable in your case.
Best Regards,
Petar IvanovDeveloper Support EngineerInfragistics, Inc.http://ko.infragistics.com/support
Please let me know if you need more help with this matter.
I am out of town for 2 weeks. I will let you know if it works for me when I get back. Thanks for your reply!
Thank you for your reply. Feel free to contact me whenever you have the opportunity.
I am just following up to check whether you were able to resolve your issues. Please feel free to contact me if you need more help.