Hello All,
I added a UltraWebListbar in my MasterPage. On click of Groups it expands and show the list of items inside the group, and on click of any item within the Group it will go to another page(using TargetUrl property.)But the Group which is clicked is not retained, it gets collapsed. It always shows the First group as expanded..... I want to keep the group which i clicked in expanded mode.
Hope i explained my problem properly.
Thanks in Advance.
HI Sriram81,
Since you are using Master pages, when you click on an item with a targeturl set, you are rendering a complete new page and this new page does not know what group/item was clicked on in the prior page.
So what you could do is used a query string. For each Item in a group - append a query string of the group that the item belongs to the item's targeturl.
So for the first group and its items
set the item's targeturl to "Default2.aspx?group=0
Then in the page_load event of Default2.aspx retrieve the query string with int x = (int) Request.QueryString["group"].
Once you have the the group number you can expand that weblistbar's group with the following line of code
UltraWebListbar1.Groups[x].Expanded = true;
Hi,
Thank you so much for your reply.. On click of any item from group i store the clicked group id in a session variable in Master Page, and on PageLoad of child page, i find the listbar control in MasterPage and did UltraWebListbar1.Groups[x].Expanded = true; as u said, but still the first group is always shown expanded..... I am not able to find out what im doing wrong.....
Thanks,
Sriram
I had a similar problem and used the above solution attempting to use session variables to set the active group and item upon page refresh. The group could be configured fine, but when I attempted to set the item the "AutoNavigateSelectedItem" property caused a loop that kept recursively loading the page. My solution was to configure this property on the list bar to "False" and then manually call a response.redirect at the time the list item was selected. Might not be the best solution, but...it works!
Code below:
'Code to select correct item and group on nav bar based on session variables stored at time nav bar is clickedIf Not Page.IsPostBack Then
Dim intNavSelectedGroupIndex As IntegerDim intNavSelectedItemIndex As IntegerintNavSelectedGroupIndex = Convert.ToInt32(Session("NavSelectedGroup"))intNavSelectedItemIndex = Convert.ToInt32(Session("NavSelectedItem")) Dim oSelectedGroup As Infragistics.WebUI.UltraWebListbar.Group = LeftNavMenu.Groups(intNavSelectedGroupIndex)Dim oSelectedItem As Infragistics.WebUI.UltraWebListbar.Item = oSelectedGroup.Items(intNavSelectedItemIndex)LeftNavMenu.SelectedGroup = intNavSelectedGroupIndexLeftNavMenu.SelectedItem = oSelectedItem
Dim oSelectedGroup As Infragistics.WebUI.UltraWebListbar.Group = LeftNavMenu.Groups(intNavSelectedGroupIndex)Dim oSelectedItem As Infragistics.WebUI.UltraWebListbar.Item = oSelectedGroup.Items(intNavSelectedItemIndex)LeftNavMenu.SelectedGroup = intNavSelectedGroupIndexLeftNavMenu.SelectedItem = oSelectedItem
End Sub
Session("NavSelectedGroup") = LeftNavMenu.SelectedGroupSession("NavSelectedItem") = LeftNavMenu.SelectedItem.Index
HI , sure use another session variable.
Hi Matt Traynor,
Thanks.,At last i am able to preserve and show the selected group expanded, now i need to show the Item that isClicked.
//Page_ Load code is below
{
wlRightMenu.Groups[Convert.ToInt32(Session[SELECTEDGROUP])].Expanded = true;
}
//Item clicked Event
Session[SELECTEDGROUP] = wlRightMenu.SelectedGroup;
Should i make use of another session variable to preserve the item clicked also?.... or any other way t o proceed.
Hi Sriram, send me a code snippet.