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

Dynamic RadToolBarButton Image Problem

7 Answers 185 Views
FileExplorer
This is a migrated thread and some comments may be shown as answers.
n/a
Top achievements
Rank 1
n/a asked on 22 Apr 2009, 11:46 AM

Having a little trouble trying to create a dynamic button - if I add an image URL I simply get my image...

tbBtn = New RadToolBarButton
tbBtn.ImageUrl = "trans.gif"
rfeMediaManager.ToolBar.Items.Add(tbBtn)
 

As soon as I add a text value a default telerik refresh image appears...?

tbBtn = New RadToolBarButton
tbBtn.ImageUrl = "trans.gif"   
tbBtn.Text = "Standard Mode"
rfeMediaManager.ToolBar.Items.Add(tbBtn)

How can I have only my own image and text?

7 Answers, 1 is accepted

Sort by
0
Tervel
Telerik team
answered on 27 Apr 2009, 01:01 PM
Hello n/a,

The RadFileExplorer's toolbar uses CSS sprites to reduce the number of images needed.
Hence, to put a custom image + text on your custom button, you should go along the following lines:

//In the code behind
tbBtn.Text = "Standard Mode";
tbBtn.CssClass = "CustomButton";
FileExplorer1.ToolBar.Items.Add(tbBtn);

//On the ASPX page
       <style>
        .CustomButton
        {
            border:1px solid red !important;
            /*  set background image here */ 
        }
        </style>



Greetings,
Tervel
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
DGPunkt
Top achievements
Rank 1
answered on 13 Jan 2010, 02:09 PM
Hello,

I have a very similar problem, but I tried your solution and it did not work.

I have just that blank asp.net page with a fileexplorer:

<

 

telerik:RadFileExplorer runat="server" ID="FileExplorer1" Width="520px" Height="520px">

 

 

        <Configuration ViewPaths="~/" UploadPaths="~/" DeletePaths="~/" />

 

 

</telerik:RadFileExplorer>

In codebehind .cs file I just add a RadToolBarSplitButton to the fileexplorers toolbar and add some RadToolBarButtons to that splitbutton. I don´t want to see any (refresh-) images on these buttons. So codebehind looks like this:

 

FileExplorer1.InitialPath = Page.ResolveUrl("~/");

RadToolBarSplitButton radToolBarSplitButton = new RadToolBarSplitButton("Repository");
radToolBarSplitButton.Buttons.Add(new RadToolBarButton("Demo"));
radToolBarSplitButton.Buttons.Add(new RadToolBarButton("Manual"));
FileExplorer1.ToolBar.Items.Add(radToolBarSplitButton);

I tried your solution with "background-image:none;" in style part of aspx page, but nothing happened. Even if I set "background-image:test.jpg" a different image than refresh - image is not shown.

AND

As a second problem, the (refresh) image is shown in the background of the buttons text, not to it´s left. The funny thing is: This behaviour changes, if I put a RadToolBar on the page (right before the fileexplorer).

I hope you can help.


Greetings from Berlin, Germany

Daniel

0
Fiko
Telerik team
answered on 18 Jan 2010, 09:12 AM
Hello DGPunkt,

I believe that this code library will be of help.

Best wishes,
Fiko
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
friendz 4u
Top achievements
Rank 1
answered on 26 Mar 2010, 12:35 PM
HI,
I not being able to access the code library you have mentioned here.
thanks
Arpan
0
Lini
Telerik team
answered on 26 Mar 2010, 03:24 PM
Hello Arpan,

I have fixed the link in Fiko's post. Try accessing it again.

Regards,
Lini
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.
0
Ashok
Top achievements
Rank 1
answered on 20 Dec 2011, 06:04 PM
I have tried same code. But the refresh icon does not removed. sol give me good solution
0
Ashok
Top achievements
Rank 1
answered on 20 Dec 2011, 06:14 PM
It's worked fine,
Thanks
Tags
FileExplorer
Asked by
n/a
Top achievements
Rank 1
Answers by
Tervel
Telerik team
DGPunkt
Top achievements
Rank 1
Fiko
Telerik team
friendz 4u
Top achievements
Rank 1
Lini
Telerik team
Ashok
Top achievements
Rank 1
Share this question
or