RadButton with two toggle states does not show image

2 posts, 1 answers
  1. Rob
    Rob avatar
    8 posts
    Member since:
    Aug 2010

    Posted 13 Dec 2012 Link to this post

    I want to put a button on the page that uses the ConfirmBtn-Grey.jpg image when the page loads, and then when the button is clicked it should display ConfirmBtn-Selected.jpg.

    I'm using the following RadButton definition, but not getting any images displayed on my page...

    <telerik:RadButton ID="RadButton1" runat="server" ButtonType="ToggleButton" ToggleType="CustomToggle">
        <ToggleStates>
            <telerik:RadButtonToggleState Selected="true" ImageUrl="../images/ConfirmBtn-Grey.jpg" />
            <telerik:RadButtonToggleState ImageUrl="../images/ConfirmBtn-Selected.jpg" />
        </ToggleStates>
    </telerik:RadButton>

    I've checked the paths to my images using Firebug and it's picking them up ok. Have I defined the button incorrectly?

    Rob
  2. Answer
    Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 13 Dec 2012 Link to this post

    Hi,

    I have made some modifications in your code. I was able to set the image by setting height and width for the button. Here is the sample code.
    aspx:
    <telerik:RadButton ID="RadButton1" Width="58px" Height="59px" runat="server" ButtonType="ToggleButton"ToggleType="CustomToggle">
     <ToggleStates>
                    <telerik:RadButtonToggleState Selected="true" ImageUrl="Images/img.png" />
                    <telerik:RadButtonToggleState ImageUrl="Images/img.gif" />
      </ToggleStates>
    </telerik:RadButton>

    Thanks,
    Shinu.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top