displays two lines of stars

6 posts, 1 answers
  1. Roberts
    Roberts avatar
    2 posts
    Member since:
    Aug 2011

    Posted 22 Aug 2011 Link to this post

    I tested the RadRating with a RadGrid and the time to show
    results displays two lines of RadRating to select and the other with the assigned value.

    As I show only the value of RadRating?


    <telerik:RadGrid runat="server" ID="gridResults" AllowPaging="true" GridLines="None" OnItemDataBound="ResultsItemDataBound" AutoGenerateColumns="false" PageSize="10" Width= "570px" 
    <ItemStyle BackColor="White" BorderColor="White" BorderWidth="0px" />
    <AlternatingItemStyle BackColor="White" BorderColor="White" BorderWidth="0px" />
    <MasterTableView TableLayout="Fixed" BackColor="White" BorderColor="White" BorderStyle="None"
    BorderWidth="0px" AllowCustomSorting="true">
             <asp:Label ID="lblId" Visible="false" Text='<%#Eval("Id")%>' runat="server" />
                <div class="itemGrid">
                     <div class="cadena">
                       <asp:Image runat="server" ID="imgCadena" Visible="true" Height="75px" Width="75px" 
                            style="margin-left:12px;" ImageAlign="Left" ImageUrl='<%#Eval("thumb") %>'/><br />                                
                      <div class="hotel">                            
                      <asp:Label ID="lblHotel" runat="server" Text='<%#Eval("name") %>'></asp:Label>
                      <br />
                      <asp:Label ID="lblDesc" runat="server" Font-Size="XX-Small" ForeColor="Silver" Text='<%#Eval("desc") %>'>
                       <div class="Stars">
                       <br />
                       <div style="text-align:center; float:left;">
                       <telerik:RadRating ID="RadRating1" runat="server" DBValue='<%#Eval("starsLevel")%>' />
                       <asp:Label ID="lblStars" runat="server"></asp:Label> <br />
                       <div class="precio">
                       <br />                            
                       <asp:Label ID="lblFare" runat="server" style="font-weight:bold" />
                       <br />
                       <div id="divComprar" runat="server" clientidmode="Static">                            
                       <telerik:RadButton ID="btnComprar" runat="server" Height="56px" Width="75px" Text="Comprar"
                               ForeColor="White" OnClick="BtnComprar_OnClick" Image-IsBackgroundImage="true"
                        Image-HoveredImageUrl="~/Images/btnBuscarHovered.png" Image-ImageUrl="~/Images/btnBuscar.png" >
  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 23 Aug 2011 Link to this post

    Hello Robert,

    I suppose you want to show 4 stars for RadRating. Try setting ItemCount property which worked as expected.

      <telerik:RadRating ID="RadRating1" ItemCount="4" runat="server" DBValue='<%#Eval("starsLevel")%>'  />

  3. Slav
    Slav avatar
    1359 posts

    Posted 25 Aug 2011 Link to this post

    Hello Roberto,

    The issue you have encountered is most probably caused by custom CSS, added to your page, which affects the the proper look of the RadRating. You can make sure this is the case by removing your custom style sheets and observing the effect. Please consider checking how a particular style changes the way your page is displayed, before finally applying it.

    You can also check this online demo, which implements RadRating in RadGrid control, as it will be useful as a reference for incorporating this feature in your project.

    I hope that the provided information helps you resolve your issues.

    the Telerik team

    Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

  4. appdev
    appdev avatar
    223 posts
    Member since:
    Sep 2008

    Posted 21 Oct 2011 Link to this post

    my column is 200px wide and the start still displaying in 2 rows. why is that?
    <asp:TemplateField HeaderText="What<br>Team Member<br>Saying" ItemStyle-Width="200px">
                                                <telerik:RadRating ID="rating" runat="server" Value='<%# Convert.ToDouble(Eval("rating")) %>' ReadOnly="true" Orientation="Horizontal" />

    i also notice that the div tag is set to with="75px" how do i change this? thanks
  5. Answer
    Niko avatar
    404 posts

    Posted 25 Oct 2011 Link to this post

    Hi Duy,

    This behavior is due to the skin style sheet resources loading asynchronously through the Ajax request. In order to make sure the resources are present, you can load them with the main content. There are two basic approaches for this.
    Let's assume, first, that the skin will be the Default one.
    1. Load the styles through a link tag using the Page.ClientScript.GetWebResourceUrl method.
      <link href='<%= Page.ClientScript.GetWebResourceUrl(typeof(RadRating), "Telerik.Web.UI.Skins.Rating.css") %>' rel="stylesheet" type="text/css" />
       <link href='<%= Page.ClientScript.GetWebResourceUrl(typeof(RadRating), "Telerik.Web.UI.Skins.Default.Rating.Default.css") %>' rel="stylesheet" type="text/css" />
      Notice the name of the skin in the second link tag. If you wish to use another skin, just replace the name with that of the new one.
    2. Use the RadStyleSheetManager.
      <telerik:RadStyleSheetManager ID="StyleSheetManager1" runat="server">
                  <telerik:StyleSheetReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Skins.Rating.css" />
                  <telerik:StyleSheetReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Skins.Default.Rating.Default.css" />
      RadStyleSheetManager requires a HttpHandler registration in web.config. Please, use the control Smart Tag(from Design View) to add the handler automatically, or see the help for more information: Controls > RadStyleSheetManager.
    Either approach is equally valid and the choice depends entirely on your own preference.
    Please, let me know if you run into troubles.

    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
  6. Roberts
    Roberts avatar
    2 posts
    Member since:
    Aug 2011

    Posted 11 Nov 2011 Link to this post

    Hi Niko.
    Thank you so much!
Back to Top