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.
I apologize, I must have misclicked when attaching the sample. It should be OK this time.
As you will see in the sample page, the scroll position persistance is maintained entirely on the client. For instance expand group one, scroll down a bit and click the button which I've provided and you should see that the position is maintained.
The UltraWebListbar in the sample is using a simple configuration and as far as styling goes I've set the onhover and onselection background colors.
Please let me know if this works for you.
Best Regards,
Petar IvanovDeveloper Support EngineerInfragistics, Inc.http://es.infragistics.com/support
i should note that initially I have 2 groups designed into listbar and 1 item in the first group. This is just for design layout. When the page is ran I do not do anything to the listbar until a webtab is clicked in which I then clear the groups of the listbar and load new groups and items programmatically. Would the fact that the listbar is embeded in a UltraWebTab matter? When i click on an item of the listbar I then fill a grid with data.
The ig_fireEvent catching an exception usually means that the the handler function (in this case InitializeLayout) is not syntactically correct and cannot be parsed. The issue does not seem to be version related as my sample seems to be operating correctly with build 1003.
As per your other questions: you should be able to embed the Listbar inside an UltraWebTab. If you are handling client-side events, is it possible that you are cancelling the postback by returning true in some handler ?
Regarding the styling of selected items - I am so far unable to replicate the issue. I would really appreciate some sample code illustrating your issues as it will allow me to be give more specific feedback.
Please let me know if you have any additional questions.
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.
Thank you for your reply. Feel free to contact me whenever you have the opportunity.
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!
Please let me know if you need more help with this matter.
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.