Telerik Forums
UI for ASP.NET AJAX Forum
7 answers
207 views
Hi there

I am probably doing something really stupid or not understanding how to link up to the datasource properly but I have been working on this for a couple of days and I can't seem to work out how to get the rating to work with a datasource.

I have a stand alone rating control on my page that I wanted to link up to an  accessdatasource that would display the current rating.  (I also want to be able to allow users to rate using the same control and save the value into the database too, but that's another story)

Here is what I have

<div id="info">
            Hover over image for options and info <table id="rating">
                <tr>
                    <td>Rate this album:</td><td>
                        <telerik:RadRating ID="RadRating1" runat="server" AutoPostBack="True" Skin="Metro" DataSourceID="AccessDataSource3" Precision="Item" AppendDataBoundItems="True">
                            <ItemBinding ValueField="AverageRatingRounded"></ItemBinding>                                 
                        </telerik:RadRating>
                    </td>
                </tr>
            </table>
        </div>
 
 
 
 <asp:AccessDataSource ID="AccessDataSource3" runat="server" DataFile="~/App_Data/ASPNetDB.accdb"
        SelectCommand="SELECT AlbumID, CountRating, Totalrating, SUM(Totalrating) / CountRating AS AverageRating, ROUND(AverageRating, 0) AS AverageRatingRounded FROM qryRating GROUP BY AlbumID, CountRating, Totalrating HAVING (AlbumID = ?)"><SelectParameters>
            <asp:QueryStringParameter Name="AlbumID" QueryStringField="albumID" Type="Int32" />
        </SelectParameters>
         
    </asp:AccessDataSource>

As you can see, the datasource is based on a query which works out how many times the album has been rated and what the average rating is already, (by counting times rated, adding up all the ratings and dividing the total ratings by the count of times rated, then by rounding to whole value)

All that displays though is one empty star (if I hover over it, it does display the average rating though)

I have looked at EVERY demo and documentation on databinding for the rating control but I just can't seem to get my head around what I should be doing.

Please, please, please point me in the right direction before I pull all my hair out and bite my nails down to the quick

Thank you in advance


Ianko
Telerik team
 answered on 19 Dec 2014
1 answer
73 views
Hi. i´m developing an web with telerik and need to know if user has drag any header to group filtering in a postback. I can use client side o server side code, there are any way to achieve this?
Eyup
Telerik team
 answered on 19 Dec 2014
4 answers
138 views
Hi

I am using Telerik Version  2013.2.625.40 , is the Batch Update Exist in RadTreeList ?.
This is clients requirement ,

Please let me know

Karthik.K

Karthik Kantharaj
Top achievements
Rank 1
 answered on 19 Dec 2014
5 answers
369 views
I am binding my grid dynamically on the client side with JSON data similar to this example http://demos.telerik.com/aspnet-ajax/grid/examples/client/livedata/defaultcs.aspx. However I cannot get paging to work.

There is no mention on this page http://www.telerik.com/help/aspnet-ajax/client-side-binding-specifics.html of any limitations with paging. I have 25 items in my datasource and the page size is set to 10. However my grid footer shows " Page 1 of 2, items 1 to 10 of 11. " when displaying all 25 items.
<telerik:RadGrid runat="server" ID="RadGrid1" AllowPaging="true" AllowSorting="true" AllowFilteringByColumn="true" PageSize="10">

Do I need to specify anything else to get it to show the correct number of records?
John
Top achievements
Rank 1
 answered on 18 Dec 2014
6 answers
69 views
hey guys need some help here as we're upgrading or trying to upgrade telerik controls from:
File Version 2010.1.519.35  to File Version 2013.3.1114.40

there's an issue in the rad Filter as it cannot find the ControlName which back then was "rfContextMenu" but now I have no idea.

if it references a different "default Name" for the controls, I could do a simple find and replace. can someone help me out here cuz I have a lot of "code behind" for 66+ filters for prerender, apply and item command that the program is dependent on .
thanks 
rik - below is the code behind that can't find "rfContextMenu"

 protected void WorkOrdersRadFilter_PreRender(object sender, EventArgs e)
        {
            RadContextMenu menu = WorkOrdersRadFilter.FindControl("rfContextMenu") as RadContextMenu;
            WorkOrdersRadFilter.RootGroupItem.Controls[2].Controls[1].Visible = false;
            menu.DefaultGroupSettings.Height = Unit.Pixel(250);
            menu.EnableAutoScroll = true;
            WorkOrdersRadFilter.Culture = Thread.CurrentThread.CurrentCulture;            renameFilter();
            var ctrl = ControlsOfType<ITextControl>(WorkOrdersRadFilter).Where(p => p.GetType() != typeof(LiteralControl));
            if (ctrl.Count() > 0)
                (ctrl.Last() as Control).Focus();
            foreach (var picker in ControlsOfType<RadDateTimePicker>(sender as Control))
            {
               // picker.SelectedDate = DateTime.Today;
                picker.DateInput.DateFormat = "MM/dd/yyyy";
                picker.DateInput.DisplayDateFormat = "MM/dd/yyyy";
            }
        }
rik butcher
Top achievements
Rank 1
 answered on 18 Dec 2014
1 answer
168 views
I was able to create a radtreeview using your example with checkboxes.  Now i need to check and uncheck certain values on first page load in vb.  Please advice.  Below is my code.  Thank You.

<div id="divMnuLeft">
   <telerik:RadTreeView ID="lstMenuItem1" CheckBoxes="true" TriStateCheckBoxes="true" CheckChildNodes="true" runat="server">
   <DataBindings>
          <telerik:RadTreeNodeBinding Expanded="true" />
   </DataBindings>
  </telerik:RadTreeView>
</div>
Private Sub Populate_tblMenuItems1()
        Dim dt As New DataTable
        Dim con As New clsSQLConnector
 
        dt = con.GetWebUserMenuItem(2, ViewState("WebUserID"))
        If dt Is Nothing = False Then
            If dt.Rows.Count > 0 Then
                lstMenuItem1.DataTextField = "Descr"
                lstMenuItem1.DataFieldID = "menuID"
                lstMenuItem1.DataFieldParentID = "ParentID"
                lstMenuItem1.DataSource = dt
                Dim binding As New RadTreeNodeBinding
                binding.CheckedField = "isAssigned"
                binding.Checkable = True
                lstMenuItem1.DataBindings.Add(binding)
                lstMenuItem1.DataBind()
                'For Each dr As DataRow In dt.Rows
                'Next
            End If
        End If
    End Sub

Joseph
Top achievements
Rank 1
 answered on 18 Dec 2014
1 answer
158 views
Dear folks,
                   I have a  radgrid that display monthly schedule for a ROTA application. This schedule is coming from a table in the database Sometimes, a schedule needs to be revised, which means making changes to certain days schedules in a month. Before any revision  i want to be able to take a snapshot of the radgrid as an excel file and save it into a filed of type varbinary in a table.
I want this snapshot process to occur in one go, all in memory where it would convert the datatable to excel format and then save to table as an excel file which could be later downloaded for vieweing. I want t avoid the step of exporting the file externally and saving on a location. 

pLS help, i will be extremely grateful
Pavlina
Telerik team
 answered on 18 Dec 2014
5 answers
143 views
The documentation states the argument of LoadClientState is a string, this doesn't seem to be correct for RadGrid, it is a Dictionary<string,object>, and there is no overload that takes a string. 

is there another IClientStateManager for collections?
Marin
Telerik team
 answered on 18 Dec 2014
1 answer
208 views
I have the scheduler implemented in an iframe, where clicking on Day, Week, or Month view opens up a popup window with the scheduler displayed again. Because this window is resizable (except in IE), Id like the scheduler to resize with the window. Currently this can be achieved by setting the width to 100% on its parent container. The problem is that the scheduler grows larger, but does not shrink with the window. So I when I try to re-shrink the window the right side of the scheduler just gets covered up instead of shrinking like I expect. If a postback is fired then the scheduler resizes correctly, but there has to be a better solution than that. Is there a setting I am missing? Maybe there is a possible workaround? Here is the aspx code of the table that contains the scheduler.Tthere aren't any JavaScript blocks associated with resizing at this point. Any Help is appreciated.

<table style="width:100%;">
                    <tr style="text-align:center;">
                        <td style="vertical-align:top;">
                            <table id="inputs" style="height:50px;">
                                <tr>
                                    <td style="width:50%;"></td>
                                    <td style="text-align:right; vertical-align:middle;">Type:</td>
                                    <td style="vertical-align:middle;">
                                        <telerik:RadComboBox
                                            CheckBoxes="true"
                                            runat="server"
                                            ID="cmbCheckAppointmentType"
                                            OnItemChecked="cmbCheckAppointmentType_ItemChecked"
                                            AutoPostBack="true">
                                        </telerik:RadComboBox>
                                    </td>
                                    <td style="text-align:right; vertical-align:middle;">System:</td>
                                    <td style="vertical-align:middle;">
                                        <telerik:RadDropDownList
                                        runat="server"
                                        ID="ddlSystemType"
                                        OnSelectedIndexChanged="ddlSystemType_SelectedIndexChanged"
                                        AutoPostBack="true">
                                            <Items>
                                                <telerik:DropDownListItem Text="Both" Value="843,835,834" Selected="true" />
                                                <telerik:DropDownListItem Text="Student" Value="835"/>
                                                <telerik:DropDownListItem Text="Business" Value="834" />
                                            </Items>
                                        </telerik:RadDropDownList>
                                    </td>
                                    <td style="width:50%;"></td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                    <tr>
                        <td>
                        <telerik:RadToolTipManager runat="server" ID="telToolTipManager" RelativeTo="Mouse" ShowEvent="OnMouseOver"
                            Animation="None" HideEvent="LeaveTargetAndToolTip" Text="Loading..." OnAjaxUpdate="telToolTipManager_AjaxUpdate">
                        </telerik:RadToolTipManager>
                        <telerik:RadScheduler
                            runat="server"
                            ID="telCalendar"
                            DataKeyField="ID"
                            DataSubjectField="Subject"
                            DataDescriptionField="Description"
                            DataStartField="Start"
                            DataEndField="End"
                            DataRecurrenceField="RecurrenceRule"
                            DataRecurrenceParentKeyField="RecurrenceParentID"
                            ShowAllDayRow="false"
                            DayStartTime="07:00:00"
                            WorkDayStartTime="07:00:00"
                            DayEndTime="18:00:00"
                            WorkDayEndTime="18:00:00"
                            EnableDescriptionField="false"
                            Width="100%"
                            Height="600px"
                            StartEditingInAdvancedForm="false"
                            AllowDelete="false"
                            AllowEdit="false"
                            AdvancedForm-EnableTimeZonesEditing="true"
                            AgendaView-ResourceMarkerType="Block"
                            AgendaView-UserSelectable="true"
                            AgendaView-NumberOfDays="30"
                            AgendaView-HeaderDateFormat="dd/MMM"
                            AgendaView-GroupingDirection="Vertical"
                            AgendaView-TimeColumnWidth="200px"
                            MonthView-UserSelectable="true"
                            MonthView-VisibleAppointmentsPerDay="5"
                            TimelineView-UserSelectable="false"
                            WeekView-UserSelectable="true"
                            DayView-UserSelectable="true"
                            OnClientAppointmentContextMenu="OnClientAppointmentContextMenu"
                            OnNavigationComplete="telCalendar_NavigationComplete"
                            OnAppointmentInsert="telCalendar_AppointmentInsert"
                            OnAppointmentUpdate="telCalendar_AppointmentUpdate"
                            OnAppointmentDelete="telCalendar_AppointmentDelete"
                            OnAppointmentCreated="telCalendar_AppointmentCreated"
                            OnAppointmentDataBound="telCalendar_AppointmentDataBound"
                            OnDataBound="telCalendar_DataBound"
                            OnFormCreating="telCalendar_FormCreating"
                            CustomAttributeNames="FullSubject"
                            Skin="Silk">
                            <AdvancedForm Modal="true" />
                            <TimeSlotContextMenuSettings EnableDefault="false"></TimeSlotContextMenuSettings>
                            <AppointmentContextMenuSettings EnableDefault="false"></AppointmentContextMenuSettings>
                            <AppointmentTemplate>
                                <div style="margin: 0px 3px 0px 3px;">
                                    <asp:Literal ID="AptType" runat="server" Text='<%# Eval("Attributes[\"FullSubject\"]") %>'></asp:Literal>
                                </div>
                            </AppointmentTemplate>
                        </telerik:RadScheduler>
                        </td>
                    </tr>
                </table>
Jacob
Top achievements
Rank 1
 answered on 18 Dec 2014
3 answers
163 views
My first attempt did not go well. I've looked at samples, etc. and still can't get this to work. The issues are:

1) I can't get the Y-Axis line to display at the left.
2) I can't get the MinorTick lines to go away.
3) I want to put a red line along the 90% mark and label it as Target.

Chart code and picture of what I'm getting provided below.

<
telerik:RadHtmlChart ID="RadHtmlChart1" runat="server" DataSourceID="supplierAverage" Height="500px" Skin="WebBlue" Width="800px" Visible="true">
    <charttitle Text="FWM SUPPLIER ON-TIME DELIVERY">
        <appearance Align="Center" Position="Top" visible="True">
        </appearance>
    </charttitle>
 
    <Legend>
        <Appearance position="Bottom" Visible="True"></Appearance>
    </Legend>
 
    <plotarea>
        <Series>
            <telerik:ColumnSeries Name="Hardware" DataFieldY="Hardware">
                <LabelsAppearance DataFormatString="{0}%"></LabelsAppearance>
                <SeriesItems>
                </SeriesItems>          
            </telerik:ColumnSeries>
            <telerik:ColumnSeries Name="Raw Materials" DataFieldY="RawMaterials">
                <LabelsAppearance DataFormatString="{0}%"></LabelsAppearance>
                <SeriesItems>
                </SeriesItems>          
            </telerik:ColumnSeries>
        </Series>
        <XAxis DataLabelsField="Month" Visible="True" MinorTickType="None" AxisCrossingValue="1" MaxValue="12" MinValue="1" Step="1">
            <LabelsAppearance DataFormatString="{0}" />
        </XAxis>
        <YAxis maxvalue="100" minvalue="0" name="Percentage" step="10" MinorTickSize="0" MinorTickType="None" Visible="True">
            <TitleAppearance Position="Center" Text="Percentage" />
        </YAxis>
 
    </plotarea>
</telerik:RadHtmlChart>
BMac
Top achievements
Rank 1
 answered on 18 Dec 2014
Narrow your results
Selected tags
Tags
+? more
Top users last month
Edmond
Top achievements
Rank 1
Iron
fabrizio
Top achievements
Rank 2
Iron
Veteran
RobMarz
Top achievements
Rank 2
Iron
Fakhrul
Top achievements
Rank 1
Iron
Tejas
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Edmond
Top achievements
Rank 1
Iron
fabrizio
Top achievements
Rank 2
Iron
Veteran
RobMarz
Top achievements
Rank 2
Iron
Fakhrul
Top achievements
Rank 1
Iron
Tejas
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?