This is a migrated thread and some comments may be shown as answers.

MenuItem is not displayed in main menu

9 Answers 117 Views
Menu
This is a migrated thread and some comments may be shown as answers.
Bichitra
Top achievements
Rank 1
Bichitra asked on 17 Sep 2008, 01:24 AM
Hi,

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

Sort by
0
Hristo
Telerik team
answered on 17 Sep 2008, 06:45 AM
Hi Bichitra,

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.
0
Bichitra
Top achievements
Rank 1
answered on 17 Sep 2008, 11:19 AM
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);


// This is my class inherited from RadMenuItem

public class XYZ : RadMenuItem

{

public XYZ()

:

base()

{

}

}


0
Bichitra
Top achievements
Rank 1
answered on 17 Sep 2008, 11:20 AM
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);


// This is my class inherited from RadMenuItem

public class XYZ : RadMenuItem

{

public XYZ()

:

base()

{

}

}


Thanks
Bichitra
0
Bichitra
Top achievements
Rank 1
answered on 17 Sep 2008, 11:20 AM

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()

{

}

}

0
Hristo
Telerik team
answered on 18 Sep 2008, 10:13 AM
Hi Bichitra,

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.
0
Bichitra
Top achievements
Rank 1
answered on 18 Sep 2008, 09:53 PM
Hi,

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
0
Hristo
Telerik team
answered on 19 Sep 2008, 11:37 AM
Hi 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.
0
Bichitra
Top achievements
Rank 1
answered on 21 Sep 2008, 10:37 PM
Hi,

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

0
Hristo
Telerik team
answered on 23 Sep 2008, 12:50 PM
Hello 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.
Tags
Menu
Asked by
Bichitra
Top achievements
Rank 1
Answers by
Hristo
Telerik team
Bichitra
Top achievements
Rank 1
Share this question
or