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

displays two lines of stars

5 Answers 122 Views
Rating
This is a migrated thread and some comments may be shown as answers.
Roberts
Top achievements
Rank 1
Roberts asked on 22 Aug 2011, 04:41 PM
Hi.
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?

Thanks.

<telerik:RadGrid runat="server" ID="gridResults" AllowPaging="true" GridLines="None" OnItemDataBound="ResultsItemDataBound" AutoGenerateColumns="false" PageSize="10" Width= "570px" 
AllowSorting="true">
<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">
    <ItemTemplate>
         <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>                            
                  <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") %>'>
                   </asp:Label>
                   </div>                                                       
                   <div class="Stars">
                   <br />
                   <div style="text-align:center; float:left;">
                   <telerik:RadRating ID="RadRating1" runat="server" DBValue='<%#Eval("starsLevel")%>' />
                   </div>                            
                   <asp:Label ID="lblStars" runat="server"></asp:Label> <br />
                   </div>
                   <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" >
                   </telerik:RadButton>
                   </div>                                                        
                   </div>                                            
                    </ItemTemplate>
                    <Columns>
                           //etc. 
                    </Columns>
                </MasterTableView>
            </telerik:RadGrid>

5 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 23 Aug 2011, 08:02 AM
Hello Robert,

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

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

Thanks,
Princy.
0
Slav
Telerik team
answered on 25 Aug 2011, 10:46 AM
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.

Greetings,
Slav
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 >>

0
appdev
Top achievements
Rank 1
answered on 22 Oct 2011, 04:23 AM
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">
                                        <ItemTemplate>
                                            <telerik:RadRating ID="rating" runat="server" Value='<%# Convert.ToDouble(Eval("rating")) %>' ReadOnly="true" Orientation="Horizontal" />
                                        </ItemTemplate>
                                    </asp:TemplateField>

i also notice that the div tag is set to with="75px" how do i change this? thanks
0
Accepted
Niko
Telerik team
answered on 25 Oct 2011, 03:49 PM
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">
            <StyleSheets>
                <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" />
            </StyleSheets>
        </telerik:RadStyleSheetManager>
    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.

Regards,
Niko
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
0
Roberts
Top achievements
Rank 1
answered on 11 Nov 2011, 10:23 PM
Hi Niko.
Thank you so much!
Tags
Rating
Asked by
Roberts
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Slav
Telerik team
appdev
Top achievements
Rank 1
Niko
Telerik team
Roberts
Top achievements
Rank 1
Share this question
or