Dynamic RadToolBarButton Image Problem

8 posts, 0 answers
  1. n/a
    n/a avatar
    1 posts
    Member since:
    Jan 2009

    Posted 22 Apr 2009 Link to this post

    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?

  2. Tervel
    Admin
    Tervel avatar
    1337 posts

    Posted 27 Apr 2009 Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. DGPunkt
    DGPunkt avatar
    20 posts
    Member since:
    Apr 2007

    Posted 13 Jan 2010 Link to this post

    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

  5. Fiko
    Admin
    Fiko avatar
    1406 posts

    Posted 18 Jan 2010 Link to this post

    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.
  6. friendz 4u
    friendz 4u avatar
    4 posts
    Member since:
    Mar 2010

    Posted 26 Mar 2010 Link to this post

    HI,
    I not being able to access the code library you have mentioned here.
    thanks
    Arpan
  7. Lini
    Admin
    Lini avatar
    2144 posts

    Posted 26 Mar 2010 Link to this post

    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.
  8. Ashok
    Ashok avatar
    3 posts
    Member since:
    Nov 2011

    Posted 20 Dec 2011 Link to this post

    I have tried same code. But the refresh icon does not removed. sol give me good solution
  9. Ashok
    Ashok avatar
    3 posts
    Member since:
    Nov 2011

    Posted 20 Dec 2011 Link to this post

    It's worked fine,
    Thanks
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017