RadMenuItem / Late binding

4 posts, 1 answers
  1. Christian Pardun
    Christian Pardun avatar
    112 posts
    Member since:
    May 2010

    Posted 15 Sep 2010 Link to this post

    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

     

  2. Cori
    Cori avatar
    562 posts
    Member since:
    Jul 2010

    Posted 15 Sep 2010 Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Christian Pardun
    Christian Pardun avatar
    112 posts
    Member since:
    May 2010

    Posted 16 Sep 2010 Link to this post

    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
  5. Answer
    Kalina
    Admin
    Kalina avatar
    918 posts

    Posted 16 Sep 2010 Link to this post

    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
Back to Top