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

RadMenuItem / Late binding

3 Answers 75 Views
Menu
This is a migrated thread and some comments may be shown as answers.
Christian
Top achievements
Rank 1
Christian asked on 15 Sep 2010, 04:07 PM
Dear Support-Team

I want to late bind a constant to the value property of the radmenuitem. If I try it it wouldn't e renderd. Why?

 

<telerik:RadMenuItem

 

 

    runat="server"

 

 

    Text="Text"

 

 

    Value="<%= WebFrontend.Constants.RadMenu.EditAccessory %>"

 

 

    HoveredImageUrl="~/Images/cmdAdd16x16.png"

 

 

    ImageUrl="~/Images/cmdAdd16x16.png">

 

 

</telerik:RadMenuItem>

Thanks in advanced.
Christian

 

3 Answers, 1 is accepted

Sort by
0
Cori
Top achievements
Rank 2
answered on 15 Sep 2010, 05:32 PM
Hello Uwe,

You should change you binding declaration to something like this:

Value="<%# WebFrontend.Constants.RadMenu.EditAccessory %>"

I changed the "=" to "#", since that is the binding syntax.

I hope that helps.
0
Christian
Top achievements
Rank 1
answered on 16 Sep 2010, 08:06 AM
Hello,

unfortunately that hint doesn't help. If I try it in that way the value propertery has a empty string!

Any suggestion?

Kind regards
Christian
0
Accepted
Kalina
Telerik team
answered on 16 Sep 2010, 02:54 PM
Hello Uwe Krall,

Could you please make sure that you databind the RadMenu?
In order to apply the databinding expression you need to call RadMenu.DataBind():

<telerik:RadMenu ID="RadMenuTest" runat="server" >
    <Items>
        <telerik:RadMenuItem runat="server" Text="Text" Value="<%# EditAccessory %>">
        </telerik:RadMenuItem>
    </Items>
</telerik:RadMenu>

protected string EditAccessory = "test";
protected void Page_Load(object sender, EventArgs e)
{
    RadMenuTest.DataBind();
}

I hope this helps.

Greetings,
Kalina
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
Menu
Asked by
Christian
Top achievements
Rank 1
Answers by
Cori
Top achievements
Rank 2
Christian
Top achievements
Rank 1
Kalina
Telerik team
Share this question
or