Making the Toolbar User-configurable

5 posts, 0 answers
  1. Stuart Hemming
    Stuart Hemming avatar
    1622 posts
    Member since:
    Jul 2004

    Posted 22 Sep 2010 Link to this post

    I have a class that I use to supply the image URL for toolbars. The values are held in an XML file.

    I can use this quite successfully to set the ImageUrl of the various buttons in the page's code-behind.

    I'd like to be able to use the same idea for populating this property in the markup.

    I thought to just write something like this ...
    <telerik:RadToolBarButton Value="Add" ImageUrl='<%= IconManager.GetButton("Add") %>' />
    But, it seems, you can't do that.

    Is there a way around this or a way to achieve the same result?

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

    Posted 23 Sep 2010 Link to this post

    Hello Stuart,

    Wouldn't you use the binding syntax "<%#", instead of "<%=" to assign properties to a server control?

     

    Perhaps that is the issue.

  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Stuart Hemming
    Stuart Hemming avatar
    1622 posts
    Member since:
    Jul 2004

    Posted 23 Sep 2010 Link to this post

    Nah, I tried that yesterday.

    I've actually come up with a nice solution (or most of one, anyway) in the code behind that requires no effort on the part of the page developer.

    I'll prolly post something here when I've finished it.

    -- 
    Stuart
  5. Guy
    Guy avatar
    10 posts
    Member since:
    Mar 2009

    Posted 16 Nov 2010 Link to this post

    Still not finished ?  Or forgotten to post it ?  ;-)
  6. Stuart Hemming
    Stuart Hemming avatar
    1622 posts
    Member since:
    Jul 2004

    Posted 20 Nov 2010 Link to this post

    I never did get it to work, so I replaced ImageUrl (and IconUrl, where appropriate) with a custom attribute and, as all our pages and controls inherit from the same base classes, I wrote a couple of methods to look for the custom attribute and to then get the correct value from my Catalogue file and set the ImageUrl (or IconUrl) appropriately.

    -- 
    Stuart
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017