I have created new class which inhertited from RadMenuItem.
and added som new properties.
I am trying to add menuItem
e,g. Class X : RadMeuItem
{
Public X():base()
{
}
public string GroupId
{
get{};
set{};
}
}
I am trying to add
X x = new X();
x.Header="My header"
RadMenu rdMenu = new RadMenu()
rdMenu.Items.Add(x);
It doesnot display the menu item in the menu.
Would you Like to help ?
Thanks
Bichitra Pattanayak
Xcel Solution.
9 Answers, 1 is accepted
I was not able to reproduce the problem at our side. Everything worked as expected with the descendants of RadMenuItem.
Did you add rdMenu to the Page (VS default template creates Grid with x:Name="LayoutRoot") like:
this.LayoutRoot.Children.Add(rdMenu)?
Regards,
Hristo
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
I did the same, that you mentioned. honestly I modified your sample code.
for programming Menu part. As I created my object ,I mean XYZ ab = new XYZ(); It is not added in MenuItem.
XYZ
ab = new XYZ() { Header = "Item 2.3", IsCheckable = true, StaysOpenOnClick = true };
RadMenuItem
menuItem2 = new RadMenuItem() { Header = "Item(checkable children)" };
menuItem2.Items.Add(ab);
myMenu.Items.Add(menuItem2);
// This is my class inherited from RadMenuItem
public class XYZ : RadMenuItem
{
public XYZ()
:
base()
{
}
}
I did the same, that you mentioned. honestly I modified your sample code.
for programming Menu part. As I created my object ,I mean XYZ ab = new XYZ(); It is not added in MenuItem.
XYZ
ab = new XYZ() { Header = "Item 2.3", IsCheckable = true, StaysOpenOnClick = true };
RadMenuItem
menuItem2 = new RadMenuItem() { Header = "Item(checkable children)" };
menuItem2.Items.Add(ab);
myMenu.Items.Add(menuItem2);
// This is my class inherited from RadMenuItem
public class XYZ : RadMenuItem
{
public XYZ()
:
base()
{
}
}
Thanks
Bichitra
Hi,
I did the same, that you mentioned. honestly I modified your sample code.
for programming Menu part. As I created my object ,I mean XYZ ab = new XYZ(); It is not added in MenuItem.
XYZ ab = new XYZ() { Header = "Item 2.3", IsCheckable = true, StaysOpenOnClick = true };
RadMenuItem menuItem2 = new RadMenuItem() { Header = "Item(checkable children)" };
menuItem2.Items.Add(ab);
myMenu.Items.Add(menuItem2
Only menuitem2 is displayed. "ab" child element under menuItem2 is not displayed.
// This is my class inherited from RadMenuItem
public class XYZ : RadMenuItem
{
public XYZ()
:
base()
{
}
}
I think the problem might be that you didn't put RadMenu (not RadMenuItem or yours XYZ) in the Page.
Can you see the menu gray background or not?
Can you send a sample project to us so that we can investigate it further? You can zip the files and attach them to a new support thread.
Thanks for your time and cooperation..
All the best,
Hristo
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Thanks for helping....
if you see my code
I have added finally
myMenu.Items.Add(menuItem2) where myMenu is RadMenu .
Simple you go to your sample code (Progamming menu module)
In the below of the .cs file create a class XYZ and inherit from RadMenuItem
Class XYZ: RadMenuItem
{
public XYX() : base();
}
and create instance of XYZ and set header property and add this item to any RadMenuItem as child in the above dynamic menu code. It is not displaying the menuItem which is created as new XYZ().
Thanks
Bichitra
Thanks & Regards
Bichitra
Thanks for your report.
I was able to reproduce your problem. It is indeed a bug in our theming mechanism that we found yesterday.
The issue will be addressed in the next public release scheduled for the end of the
month. I hope this timeframe is acceptable for you.
We apologize for the inconvenience that we might be causing you.
Kind regards,
Hristo
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
I have another issue,
If I have child RadMenuItem. , how to get the immediate parent RadMenuItem.
Suppose I have RadMenuItem item = new RadMenuItem
RadMenuItem item2 = new RadMenuItem()
Item.Items.add(Item2)
How I can get Item from Item2 object.
I am waiting for your reply.
Thanks
Bichitra
I have answered you in the other ticket.
Best wishes,
Hristo
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.