Hi,
On click of one of the RadMenuItems, I'm opening Radwindow to display another page, whereas other Menu items redirect user to different page. The issue I'm facing is when I click on that Menuitem to open RadWindow, previously selected MenuItem still remains highlighted.
As a result it shows both menu items highlighted.
Let me know how I can fix this.
Thanks,
Priyank
On click of one of the RadMenuItems, I'm opening Radwindow to display another page, whereas other Menu items redirect user to different page. The issue I'm facing is when I click on that Menuitem to open RadWindow, previously selected MenuItem still remains highlighted.
As a result it shows both menu items highlighted.
Let me know how I can fix this.
Thanks,
Priyank
8 Answers, 1 is accepted
0
Shinu
Top achievements
Rank 2
answered on 22 Nov 2013, 07:18 AM
Hi Priyank,
Please have a look into the sample code which works fine at my end.
ASPX:
C#:
Please provide your code if it doesn't help.
Thanks,
Shinu.
Please have a look into the sample code which works fine at my end.
ASPX:
<
telerik:RadMenu
ID
=
"RadMenu1"
runat
=
"server"
ClickToOpen
=
"true"
OnItemClick
=
"RadMenu1_ItemClick"
>
<
Items
>
<
telerik:RadMenuItem
Text
=
"Page1"
runat
=
"server"
NavigateUrl
=
"Alignment.aspx"
Selected
=
"true"
>
</
telerik:RadMenuItem
>
<
telerik:RadMenuItem
Text
=
"OpenRadwindow"
runat
=
"server"
>
</
telerik:RadMenuItem
>
<
telerik:RadMenuItem
Text
=
"Page2"
runat
=
"server"
NavigateUrl
=
"AddItemClientSide.aspx"
>
</
telerik:RadMenuItem
>
</
Items
>
</
telerik:RadMenu
>
C#:
protected
void
RadMenu1_ItemClick(
object
sender, Telerik.Web.UI.RadMenuEventArgs e)
{
if
(e.Item.Text ==
"OpenRadwindow"
)
{
RadWindow window =
new
RadWindow();
window.VisibleOnPageLoad =
true
;
form1.Controls.Add(window);
}
}
Please provide your code if it doesn't help.
Thanks,
Shinu.
0
Priyank
Top achievements
Rank 1
answered on 22 Nov 2013, 09:34 AM
Hi Shinu,
My code is very much similar to yours. The only difference is I'm adding Rad window to Rad window manager rather than form.
My code is very much similar to yours. The only difference is I'm adding Rad window to Rad window manager rather than form.
My Html code is like this:
<
telerik:RadMenu
ID
=
"RadMenuActions"
runat
=
"server"
SkinID
=
"RadMenu"
Flow
=
"Vertical"
OnItemClick
=
"RadMenuActions_ItemClick"
>
<
Items
>
<
telerik:RadMenuItem
runat
=
"server"
SkinID
=
"RadMenuItem"
AccessKey
=
"O"
Text
=
"Ordering"
NavigateUrl
=
"~/Domains/Items/ItemOrder/Default.aspx"
>
</
telerik:RadMenuItem
>
<
telerik:RadMenuItem
runat
=
"server"
SkinID
=
"RadMenuItem"
AccessKey
=
"e"
Text
=
"Receiving"
NavigateUrl
=
"~/Domains/Items/ItemReceive/Default.aspx"
>
</
telerik:RadMenuItem
>
<
telerik:RadMenuItem
runat
=
"server"
SkinID
=
"RadMenuItem"
AccessKey
=
"s"
Text
=
"Vendor Returns"
NavigateUrl
=
"~/Domains/Items/VendorReturn/SearchReturns.aspx"
>
</
telerik:RadMenuItem
>
<
telerik:RadMenuItem
runat
=
"server"
SkinID
=
"RadMenuItem"
AccessKey
=
"w"
Text
=
"Add New Item"
Value
=
"Add New Item"
>
</
telerik:RadMenuItem
>
<
telerik:RadMenuItem
runat
=
"server"
SkinID
=
"RadMenuItem"
AccessKey
=
"M"
Text
=
"Manage Item List"
Value
=
"Manage Item List"
>
</
telerik:RadMenuItem
>
</
Items
>
</
telerik:RadMenu
>
<
telerik:RadWindowManager
ID
=
"PartAddRadWindowManager"
runat
=
"server"
>
</
telerik:RadWindowManager
>
C# code:
protected void RadMenuActions_ItemClick(object sender, RadMenuEventArgs e)
{
switch (e.Item.Value)
{
case "Add New Item":
RadWindow window = new RadWindow();
window.ID = "ItemAddRadWindow";
window.Width = 600;
window.Height = 500;
window.NavigateUrl = @"~/Domains/Items/CreateItem/ItemAdd.aspx";
window.VisibleOnPageLoad = true;
window.Modal = true;
//window.Skin = "Sunset";
window.Behaviors = WindowBehaviors.Close | WindowBehaviors.Move;
PartAddRadWindowManager.Windows.Clear();
PartAddRadWindowManager.Windows.Add(window);
break;
case "Manage Item List":
Response.Redirect(@"~/Domains/Items/ItemList/Default.aspx");
break;
}
}
Thanks,
Priyank
0
Priyank
Top achievements
Rank 1
answered on 26 Nov 2013, 09:38 AM
Hi,
Could someone from telerik support team help me out with this?
I have been trying hard for past 2 days, but haven't found any work around for this.
I have placed the RadMenu in Usercontrol and this user control is placed in a master page.
Thanks,
Priyank
Could someone from telerik support team help me out with this?
I have been trying hard for past 2 days, but haven't found any work around for this.
I have placed the RadMenu in Usercontrol and this user control is placed in a master page.
Thanks,
Priyank
0
Hello Priyank,
Please try to deselect the clicked RadMenu item as shown in the code snippet below. The suggested line of code is marked in yellow color at the bottom of the code snippet.
//code behind
Regards,
Boyan Dimitrov
Telerik
Please try to deselect the clicked RadMenu item as shown in the code snippet below. The suggested line of code is marked in yellow color at the bottom of the code snippet.
//code behind
protected
void
RadMenuActions_ItemClick(
object
sender, RadMenuEventArgs e)
{
switch
(e.Item.Value)
{
case
"Add New Item"
:
RadWindow window =
new
RadWindow();
window.ID =
"ItemAddRadWindow"
;
window.Width = 600;
window.Height = 500;
window.NavigateUrl = @
"~/Domains/Items/CreateItem/ItemAdd.aspx"
;
window.VisibleOnPageLoad =
true
;
window.Modal =
true
;
//window.Skin = "Sunset";
window.Behaviors = WindowBehaviors.Close | WindowBehaviors.Move;
PartAddRadWindowManager.Windows.Clear();
PartAddRadWindowManager.Windows.Add(window);
break
;
}
e.Item.Selected =
false
;
}
Regards,
Boyan Dimitrov
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
0
Priyank
Top achievements
Rank 1
answered on 27 Nov 2013, 05:23 AM
Hi Boyan,
This line of code deselects the Rad menu item which is clicked. But my problem is I want to deselect previously selected menu item, not the currently clicked item.
Is there a way to do this?
Thanks,
Priyank
This line of code deselects the Rad menu item which is clicked. But my problem is I want to deselect previously selected menu item, not the currently clicked item.
Is there a way to do this?
Thanks,
Priyank
0
Hello,
An easy and convenient way of achieving such functionality would be when user clicks/selects an item to store that item's text or value so you can find that item and deselect the item as shown in my very last response. Another approach would be get all items and check whether some item is selected to deselect it.
Regards,
Boyan Dimitrov
Telerik
An easy and convenient way of achieving such functionality would be when user clicks/selects an item to store that item's text or value so you can find that item and deselect the item as shown in my very last response. Another approach would be get all items and check whether some item is selected to deselect it.
Regards,
Boyan Dimitrov
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
0
Angelo
Top achievements
Rank 1
answered on 28 Apr 2016, 01:16 PM
I am having the same problem. I have tried several things (i.e. setting focus). Nothing seams to work. Please give examples on how to do this on client and server sides.
0
Hi,
The forum is quite old so would you please elaborate a little bit the exact code that you are suing so we could be more helpful with a possible solution.
Regards,
Plamen
Telerik
The forum is quite old so would you please elaborate a little bit the exact code that you are suing so we could be more helpful with a possible solution.
Regards,
Plamen
Telerik
Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.