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

RadContextMenu

4 Answers 114 Views
Menu
This is a migrated thread and some comments may be shown as answers.
Caesar
Top achievements
Rank 1
Caesar asked on 25 Sep 2008, 08:44 AM
Hi,

I'm using the RadContextMenu together with the Microsoft GridView control. Depending on the current row, the menu displayed will be different. So I have implemented a Web Service method and a callback method looping through the items on the client (using JavaScript) hiding items that will be invisible. 

Sometimes a menu item will have sub menu items displayed. This works fine until I remove this item's children (ctxParentToClear.get_items().clear();) Then the arrow indicating the menu item has sub menu items is still there. How can I get rid of the arrow indicating sub items without reloading the whle menu?

For this to happen I have to add children in one call and clear the children in the next call.

Thanks

Janni

4 Answers, 1 is accepted

Sort by
0
Serrin
Top achievements
Rank 1
answered on 25 Sep 2008, 02:31 PM
Hey Janni,

Have you tried using the remove method that is displayed in this demo?

Add, remove, disable menu items

I'm not terribly good with all the in's and out's of RadMenu yet, but in my thinking .clear would do just that and clear what's there, but .remove would actually get rid of the child item... right?

If I were better with javascript I'd try some sample code, but I'm not, so if anyone knows how to implement this and wants to share, now would be a good time. >.<
0
Caesar
Top achievements
Rank 1
answered on 25 Sep 2008, 03:01 PM
The problem isn't that the children don't disappear. The problem is that the "arrow" indicating sub menu items on the parent menu is still there even if there are no sub menu items. 
0
T. Tsonev
Telerik team
answered on 26 Sep 2008, 02:07 PM
Hi Rikard GĂ„rdshage,

Thank you for reporting this issue. We will try to fix the issue. Meanwhile, you can use this code to hide the arrow:

ctxParentToClear.get_textElement().className = "rmText";

Your Telerik points have been update for your invol
vement.

Kind regards,
Tsvetomir Tsonev
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
pasquale
Top achievements
Rank 1
answered on 02 Feb 2009, 04:52 PM
Hi Caesar,
could you let me know ho do you succeded in implementing a radcontextmenu in a MSGridView??
I'm not able to do it!
Or, better, in the postback, inside the menuitemclick, it always return me the first element!
could you supply some code, too?
Thanks in advance!
Tags
Menu
Asked by
Caesar
Top achievements
Rank 1
Answers by
Serrin
Top achievements
Rank 1
Caesar
Top achievements
Rank 1
T. Tsonev
Telerik team
pasquale
Top achievements
Rank 1
Share this question
or