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://es.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.