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

Binding a RadMenu to a RadGrid row

1 Answer 69 Views
Menu
This is a migrated thread and some comments may be shown as answers.
Chris
Top achievements
Rank 1
Chris asked on 24 Feb 2014, 01:48 PM
Hi

I have a RadMenu inside a RadGrid Template row. The goal is to use Eval() to configure properties of the menu items by operating on the grid row, not the menu. I understand that because the menu is a naming container itself this is not directly possible.

for example <telerik:radMenuItem text='<%# Eval("SomeFieldName") %>' /> and the result would be that the text of the menu item is taken from the value of the "SomeFieldName" column of the row that it appears on.

There is a similar thread here from five years ago:
http://www.telerik.com/forums/radgrid-template-column-and-binding-to-radmenu

which offers a workaround but the link to that workaround is dead.

So, five years later and this is still a problem. We need to be able to bind radmenu items to the rows of a radgrid. It seems really obvious to me that this is something everyone would want to do, and to do it easily.

What can you suggest as a practical solution?

Thanks
Chris

1 Answer, 1 is accepted

Sort by
0
Plamen
Telerik team
answered on 27 Feb 2014, 01:40 PM
Hi Chris,

As far as I could understand you are trying to bind your RadMenu inside the ItemTemplate. The only way to achieve the desired behavior by using the RadGrid1_ItemDataBound event and bind the RadMenu as for example in this on-line demo

Hope this will be helpful. 

Regards,
Plamen
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 UI for ASP.NET AJAX, subscribe to the blog feed now.
Tags
Menu
Asked by
Chris
Top achievements
Rank 1
Answers by
Plamen
Telerik team
Share this question
or