Line Breaks before and after RadRating control

2 posts, 0 answers
  1. Scott Hannon
    Scott Hannon avatar
    18 posts
    Member since:
    Dec 2008

    Posted 06 Apr 2012 Link to this post

    Why is RadRating always displayed with a line break before and after the control? I tried using the AjaxManager and setting the rendering mode to inline, but it had no affect. Is there any way around this? Maybe it's simple and I've just missed it?

    Thanks,
    Scott
  2. Bozhidar
    Admin
    Bozhidar avatar
    677 posts

    Posted 09 Apr 2012 Link to this post

    Hi,

    As the RadRating is wrapped into a DIV element, which is a block level element, they are displayed in a column and not i a row - when you have several DIV elements on the page.

    In order to make them to appear next to each other, you have to use CSS to change the display block property to display: inline-block. The following sample code demonstrates it:

    <%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <head runat="server">
        <title></title>
        <style type="text/css">
        .RadRating
        {
            display: inline-block;
            *display: inline;
            zoom: 1;
        }
        </style>
    </head>
    <body>
        <form id="form1" runat="server">
        <asp:ScriptManager ID="sm1" runat="server" />
         
            <telerik:RadRating ID="RadRating1" runat="server" ItemCount="5"
                Value="3" SelectionMode="Continuous" Precision="Half" Orientation="Horizontal"
                 Skin="Default"
             />
         
            <telerik:RadRating ID="RadRating2" runat="server" ItemCount="5"
                Value="3" SelectionMode="Continuous" Precision="Half" Orientation="Horizontal"
                 Skin="Default"
             />
         
         
        </form>
    </body>
    </html>


    All the best,
    Bozhidar
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top