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

Re-using Telerik images

3 Answers 43 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Brock
Top achievements
Rank 1
Brock asked on 13 Nov 2008, 06:52 PM

I am building a custom pager (and custom templates) -- and I would like to re-use the images that Telerik includes.

I would like for the images that I use to "obey" the skin that has been set (i.e. the images in the pager should follow the skin that has been set for the RadGrid).

I think I have a way to do that -- but it is really  cumbersome.  Basically in the CustomPager I use the GridTableView that is passed in to get the OwnerGrid -- and from that the skin.

 

Then I use

URL = gridTableView.Page.ClientScript.GetWebResourceUrl(typeof(RadGrid),
                "Telerik.Web.UI.Skins." + skinName + ".Grid.SortAsc.gif");

to get the URL to the icon.

That seems like a lot of work -- is there a better way?

Brock.

P.S.  I am doing all this in code b/c working in SharePoint.

3 Answers, 1 is accepted

Sort by
0
Dimo
Telerik team
answered on 14 Nov 2008, 09:27 AM
Hello Brock,

Your approach is correct. Another way to do the same thing would be to set the skin for RadGrid from a variable at runtime and use the same variable when resolving the ImageUrls. In this way there will be no need to reference the GridTableView and the OwnerGrid.

Regards,
Dimo
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Brock
Top achievements
Rank 1
answered on 14 Nov 2008, 03:27 PM
OK -- thanks for the info --   I expected some static method somewhere with an enumeration of images that I could use.  I guess I am way too lazy -- comes from having Telerik do so much auto-magically ;)
0
Dimo
Telerik team
answered on 14 Nov 2008, 03:45 PM
Hello Brock,

After checking once again, it turned out there is such a method :)

RadAjaxLoadingPanel.GetWebResourceUrl(Page, "Telerik.Web.UI.Skins.SkinName.ControlName.ImageName.ImageExtension")

Here is an example:

http://demos.telerik.com/aspnet/prometheus/Grid/Examples/Programming/CustomPaging/DefaultCS.aspx

(the loading panel image URL is fetched with the above method)


Regards,
Dimo
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Grid
Asked by
Brock
Top achievements
Rank 1
Answers by
Dimo
Telerik team
Brock
Top achievements
Rank 1
Share this question
or