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

Making the Toolbar User-configurable

4 Answers 78 Views
ToolBar
This is a migrated thread and some comments may be shown as answers.
Stuart Hemming
Top achievements
Rank 2
Stuart Hemming asked on 22 Sep 2010, 07:11 PM
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

4 Answers, 1 is accepted

Sort by
0
Cori
Top achievements
Rank 2
answered on 23 Sep 2010, 02:25 PM

Hello Stuart,

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

 

Perhaps that is the issue.

0
Stuart Hemming
Top achievements
Rank 2
answered on 23 Sep 2010, 11:36 PM
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
0
Guy
Top achievements
Rank 1
answered on 16 Nov 2010, 01:08 PM
Still not finished ?  Or forgotten to post it ?  ;-)
0
Stuart Hemming
Top achievements
Rank 2
answered on 20 Nov 2010, 08:01 AM
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
Tags
ToolBar
Asked by
Stuart Hemming
Top achievements
Rank 2
Answers by
Cori
Top achievements
Rank 2
Stuart Hemming
Top achievements
Rank 2
Guy
Top achievements
Rank 1
Share this question
or