Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
93 views
Hi
I am new to telerik controls.I used radscheduler with recurrence but I am not able to get recurrence rule in server side while inserting a appointment in database.
An appointment is inserted with out the recurrence.I am binding the scheduler to a datasource.
<telerik:RadScheduler ID="RadScheduler1" runat="server"
               DataDescriptionField="CH_DESC" DataEndField="CH_TOTIME" 
               DataKeyField="CH_BOOKID" 
               DataStartField="CH_FROMTIME" DataSubjectField="CH_BOOKSUBJECT"                
               OnAppointmentDelete="RadScheduler1_AppointmentDelete"
               OnAppointmentUpdate="RadScheduler1_AppointmentUpdate"
               OnAppointmentInsert="RadScheduler1_AppointmentInsert"
               OnAppointmentCreated="RadScheduler1_AppointmentCreated"
               OnAppointmentDataBound="RadScheduler1_AppointmentDataBound"
               MinutesPerRow="15" TimeLabelRowSpan="1"
               Skin="Windows7"  GroupBy="Hall"  Height="400px"
               DayStartTime="09:00:00" DayEndTime="19:00:00" 
               WorkDayStartTime="09:00:00" WorkDayEndTime="19:00:00"
               EnableDescriptionField="True" ShowAllDayRow="False"  AdvancedForm-Modal="true"
               StartInsertingInAdvancedForm="True" AdvancedForm-Enabled="true" AdvancedForm-EnableCustomAttributeEditing="true" 
               DataRecurrenceParentKeyField="CH_RECPID"  DataRecurrenceField="CH_REC" EnableRecurrenceSupport="true">
           <AdvancedForm  EnableCustomAttributeEditing="true"/>          
           <AppointmentTemplate>
           <div class="rsCategoryViolet">
           <br />
              Subject:<%# Eval("Subject")%><br />Time:<%#Convert.ToDateTime(Eval("Start")).ToShortTimeString()%>- <%#Convert.ToDateTime(Eval("End")).ToShortTimeString()%>  <br />
          
          
           </div>
           </AppointmentTemplate>
           </telerik:RadScheduler>
       </asp:Panel>


By default CH_RECPID,CH_REC is set to empty string.
Please tell me a solution for this.
thanks in advance
Boyan Dimitrov
Telerik team
 answered on 10 Oct 2012
2 answers
108 views
Hi friends,

<telerik:RadFormDecorator ID="id runat="server" ControlsToSkip="Textbox"></telerik:RadFormDecorator>


Seems not to be working for textboxes, instead, the below serves the purpose.
<telerik:RadFormDecorator ID="id runat="server" ControlsToSkip="Textarea"></telerik:RadFormDecorator>


Am I missing something ?

Thanks,
-Aarsh
Aarsh
Top achievements
Rank 1
 answered on 10 Oct 2012
2 answers
298 views
I have a three level radgrid hierarchy and I have trouble retrieving the value for one of my columns within the 2nd level of my radgrid.  I have this code which retrieves the key for the radgrid parent as shown below:

parentItem.OwnerTableView.DataKeyValues(parentItem.ItemIndex)("ID").ToString


But I don't need the value of the key, instead I need the value of the 2nd column in one of the hierarchy levels in my radgrid.

How could I retrieve that value instead of the key....?
Aret
Top achievements
Rank 1
 answered on 10 Oct 2012
2 answers
54 views
Hi friends,

<telerik:RadFormDecorator ID="id runat="server" ControlsToSkip="Textbox"></telerik:RadFormDecorator>

Seems not to be working for textboxes, instead, the below serves the purpose.

<telerik:RadFormDecorator ID="id runat="server" ControlsToSkip="Textarea"></telerik:RadFormDecorator>


Am I missing something ?

Thanks,
-Aarsh
Aarsh
Top achievements
Rank 1
 answered on 10 Oct 2012
3 answers
110 views
In the process of updating some functionality I refactored out a user control (below).
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="TeamTodayScheduler.ascx.cs" Inherits="Private_Dashboard_TeamTodayScheduler" %>
 
<telerik:RadAjaxManager ID="ramTeamToday" runat="server">
    <AjaxSettings>
        <telerik:AjaxSetting AjaxControlID="lb">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="rsTeamToday" />
            </UpdatedControls>
        </telerik:AjaxSetting>
    </AjaxSettings>
</telerik:RadAjaxManager>
<asp:LinkButton ID="lb" runat="server" CssClass="customRSHeader" ForeColor="#333" Width="100%" OnClick="lb_Click" />
<telerik:RadScheduler ID="rsTeamToday" runat="server" AllowDelete="false" AllowEdit="false" AllowInsert="false"
        ShowFooter="false" ShowHeader="false" ShowResourceHeaders="false" SelectedView="TimelineView"
        OverflowBehavior="Expand" Visible="false" DataSourceID="ldsSchedules" DataKeyField="ScheduleID"
        DataStartField="ScheduleStartDate" DataEndField="ScheduleEndDate" DataSubjectField="EmployeeName"
        DataRecurrenceField="ScheduleRecurrenceRule" DataRecurrenceParentKeyField="ScheduleRecurrenceParentID"
        OnTimeSlotCreated="rsToday_TimeSlotCreated">
    <TimelineView GroupBy="Employee" GroupingDirection="Vertical" ReadOnly="true" ShowInsertArea="false"
        StartTime="08:00:00" SlotDuration="00:15:00" NumberOfSlots="36" TimeLabelSpan="4"
        ColumnHeaderDateFormat="h tt" EnableExactTimeRendering="true" />
    <ResourceTypes>
        <telerik:ResourceType KeyField="EmployeeID" Name="Employee" TextField="EmployeeID"
            ForeignKeyField="ScheduleEmployeeID" DataSourceID="ldsEmployees" />
        <telerik:ResourceType KeyField="ScheduleActivityTypeID" Name="Activity" TextField="ScheduleActivityTypeName"
            ForeignKeyField="ScheduleActivityTypeID" DataSourceID="ldsActivityTypes" />
    </ResourceTypes>
    <ResourceStyles>
        <telerik:ResourceStyleMapping Type="Activity" Text="Work" ApplyCssClass="WorkSchedule" />
        <telerik:ResourceStyleMapping Type="Activity" Text="Class" ApplyCssClass="ClassSchedule" />
        <telerik:ResourceStyleMapping Type="Activity" Text="Sick" ApplyCssClass="SickSchedule" />
        <telerik:ResourceStyleMapping Type="Activity" Text="Vacation" ApplyCssClass="VacationSchedule" />
        <telerik:ResourceStyleMapping Type="Activity" Text="Extended Leave of Absence" ApplyCssClass="OffSiteSchedule" />
    </ResourceStyles>
</telerik:RadScheduler>
<asp:LinqDataSource ID="ldsActivityTypes" runat="server" ContextTypeName="SciNET.BusinessObjects.SciNETDataContext"
    TableName="ScheduleActivityTypes" />
<asp:LinqDataSource ID="ldsEmployees" runat="server" ContextTypeName="SciNET.BusinessObjects.SciNETDataContext"
        TableName="Employees" OnSelecting="ldsEmployees_Selecting">
    <WhereParameters>
        <asp:Parameter DbType="Int32" Name="TeamID" />
    </WhereParameters
</asp:LinqDataSource>
<asp:LinqDataSource ID="ldsSchedules" runat="server" ContextTypeName="SciNET.BusinessObjects.SciNETDataContext"
    TableName="Schedules" OrderBy="ScheduleActivityTypeID Descending" OnSelecting="ldsSchedules_Selecting" />
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using SciNET.BusinessObjects;
using Telerik.Web.UI;
 
public partial class Private_Dashboard_TeamTodayScheduler : System.Web.UI.UserControl
{
    protected SciNETDataContext dbContext = new SciNETDataContext();
 
    public int TeamID
    {
        get { return Convert.ToInt32(ldsEmployees.WhereParameters["TeamID"].DefaultValue); }
        set { ldsEmployees.WhereParameters["TeamID"].DefaultValue = value.ToString(); }
    }
 
    protected void Page_PreRender(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            lb.Text = TeamID == 0 ? "Full-Timers" : (from team in dbContext.EmployeeTeams
                                                     where team.EmployeeTeamID == TeamID
                                                     select team).Single().EmployeeTeamName;
        }
    }
 
    protected void lb_Click(object sender, EventArgs e)
    {
        rsTeamToday.Visible = !rsTeamToday.Visible;
    }
 
    protected void rsToday_TimeSlotCreated(object sender, TimeSlotCreatedEventArgs e)
    {
        if (e.TimeSlot.Start <= DateTime.Now && e.TimeSlot.End >= DateTime.Now) e.TimeSlot.CssClass = "Highlight";
    }
 
    protected void ldsEmployees_Selecting(object sender, LinqDataSourceSelectEventArgs e)
    {
        if (TeamID == 0) e.Result = (from emp in dbContext.Employees
                                     where !emp.EmployeeDateTerminated.HasValue
                                     where emp.EmployeeRoles.Count(role => role.EmployeeRoleTypeID == 0) > 0
                                     select emp).ToList();// 0 stands for Full-timer ^^^
        else e.Result = (from emp in dbContext.Employees
                         where !emp.EmployeeDateTerminated.HasValue
                         where emp.EmployeeTeamID == Convert.ToInt32(e.WhereParameters["TeamID"])
                         where emp.EmployeeRoles.Count(role => role.EmployeeRoleTypeID == 0) == 0
                         select emp).ToList();
        if (((List<Employee>)e.Result).Count == 0) Visible = false;
    }
 
    protected void ldsSchedules_Selecting(object sender, LinqDataSourceSelectEventArgs e)
    {// Note: This grabs everyone's schedules. It's easier to let the grouping filter out the ones we don't need.
        e.Result = (from schedule in dbContext.Schedules
                    orderby schedule.ScheduleActivityTypeID descending
                    select new
                    {
                        ScheduleID = schedule.ScheduleID,
                        ScheduleSubject = schedule.ScheduleSubject,
                        ScheduleActivityTypeID = schedule.ScheduleActivityTypeID,
                        ScheduleStartDate = schedule.ScheduleStartDate,
                        ScheduleEndDate = schedule.ScheduleEndDate,
                        ScheduleEmployeeID = schedule.ScheduleEmployeeID,
                        ScheduleRecurrenceRule = schedule.ScheduleRecurrenceRule,
                        ScheduleRecurrenceParentID = schedule.ScheduleRecurrenceParentID,
                        EmployeeName = schedule.Employee.EmployeeGivenName + " " + schedule.Employee.EmployeeLastName
                    }).ToList();
    }
}
As is, a javascript TypeError: Telerik.Web.UI.RadScheduler is undefined appears, the scheduler renders and works in every aspect except that the appointments' subjects don't appear. Removing both resource types (not just one) displays the subjects. Moving the code back to the parent page just throws slightly different javascript errors--c[0] or n is undefined; usually related to some sorting thing--but visually makes no change. It seems independent of all other properties of the radscheduler. I've looked at similar issues that suggested the web.config needed a handler, but mine's setup correctly. Another suspected the grouping, but that's not the issue here.
An appointment template ignores the data; it'll display hard-coded content. The data is accessible in the code-behind, and I've used it to manipulate the Tooltip which works fine, but the appointment subject refuses to display.

From what I've gathered, it's not connecting the scripts RadScheduler needs to run, but the fix they recommended (EnableEmbeddedScripts) didn't work for me.
Boyan Dimitrov
Telerik team
 answered on 10 Oct 2012
5 answers
270 views
Hi,

Is it possible to sort aggregateField in Server-side.

I tried to add PivotGridSortExpression but that doesn't work.

var aggregateField = new PivotGridAggregateField();
rpgCA.Fields.Add(aggregateField);
aggregateField.DataField = "CA";
aggregateField.UniqueName = "CA";
aggregateField.DataFormatString = "{0:C0}";
aggregateField.TotalFormatString = "{0:C0}";
aggregateField.GrandTotalAggregateFormatString="{0:C0}";
aggregateField.TotalFormatString = "{0:C0}";
 
 
rpgCA.Rebind();

Thank you for your reply

Simon Chamaillard
Andrey
Telerik team
 answered on 10 Oct 2012
16 answers
512 views
Hello!

We've implemented custom paging but the next and previous button only work after a postback has already happened.  For example, I load the grid, click next and nothing happens.  But if I page to a page number, and then click the next button, it works.

<telerik:RadGrid ID="RadGridTicketDetails" runat="server" ActiveItemStyle-BackColor="Green"
            HeaderStyle-BackColor="#00597A" Skin="Metro" ShowGroupPanel="True" EnableLinqExpressions="False"
            OnInit="RadGridTicketDetails_OnInit" OnNeedDataSource="RadGridTicketDetails_OnNeedDataSource"
            Width="100%" CellSpacing="0" GridLines="None" OnItemCommand="RadGridTicketDetails_OnItemCommand">
            <MasterTableView TableLayout="Fixed" AllowPaging="true" AllowCustomPaging="true"
                AllowSorting="true" AllowFilteringByColumn="true" GroupsDefaultExpanded="true"
                PageSize="10" AutoGenerateColumns="false" EnableViewState="true">
                <PagerStyle Mode="NextPrevAndNumeric" AlwaysVisible="True">
                </PagerStyle>
                <EditFormSettings>
                    <EditColumn FilterControlAltText="Filter EditCommandColumn column">
                    </EditColumn>
                </EditFormSettings>
                <HeaderStyle CssClass="RadGridHeader"></HeaderStyle>
                <FooterStyle CssClass="FooterStyle"></FooterStyle>
                <CommandItemSettings ExportToPdfText="Export to PDF" />
                <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column" Visible="True">
                </RowIndicatorColumn>
                <ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column" Visible="True">
                </ExpandCollapseColumn>
                <Columns>
                    <telerik:GridBoundColumn DataField="Id" UniqueName="Id" HeaderText="#"
                        AutoPostBackOnFilter="false" />
                    <telerik:GridBoundColumn DataField="Name" UniqueName="Name" HeaderText="Name"
                        AutoPostBackOnFilter="false" Display="false"  />
                    <!-- etc... -->
                </Columns>
            </MasterTableView>
            <GroupingSettings ShowUnGroupButton="true" CaseSensitive="false" />
            <ClientSettings EnableRowHoverStyle="true" AllowDragToGroup="True" EnablePostBackOnRowClick="false"
                AllowGroupExpandCollapse="True" AllowColumnsReorder="true">
                <Selecting AllowRowSelect="True" />
                <ClientEvents OnRowClick="RowClick" />
            </ClientSettings>
            <HeaderStyle BackColor="#00597A" />
            <ActiveItemStyle BackColor="Green" />
            <PagerStyle AlwaysVisible="True" />
            <FilterMenu EnableImageSprites="False">
            </FilterMenu>
        </telerik:RadGrid>

On the first visit, the HTML of the button is
<input type="submit" class="rgPageNext" title="Next Page" value=" " name="ctl00$ctl23$g_b6bc5c7c_8c99_4d92_93de_27af5146203d$ctl00$RadGridTicketDetails$ctl00$ctl03$ctl01$ctl28">

But on the second load after an action (postback) the output is
<input type="button" class="rgPageNext" title="Next Page" onclick="javascript:__doPostBack('ctl00$ctl23$g_b6bc5c7c_8c99_4d92_93de_27af5146203d$ctl00$RadGridTicketDetails$ctl00$ctl03$ctl01$ctl28','')" value=" " name="ctl00$ctl23$g_b6bc5c7c_8c99_4d92_93de_27af5146203d$ctl00$RadGridTicketDetails$ctl00$ctl03$ctl01$ctl28">

which fires the itemcommand as it should.

Can anyone help?
Andrey
Telerik team
 answered on 10 Oct 2012
5 answers
279 views
Hi, I have a very annoying problem with my app and cant find any similar topic. I have a Page with a RadAjaxPanel containing 2 RadPanes (1 for Menu and 1 for Page content). The Page also have a second RadAjaxPanel containing some RadComboBoxes. On some predefined conditions, selecting an item in the mentionned RadComboBoxes should trigger a postback refresh on the Page content pane mentioned. Everything works but approx 10% of the time, the postback seems not be firing. When it happens I simply select something else in my RadComboBoxes and then it works. Cant find any pattern to replicate as it seems totally random.

Panel with comboboxes
<telerik:RadAjaxPanel ID="RadAjaxPanel2" runat="server">
           
               <div class="EnterpriseNodes1">
                    <telerik:RadComboBox ID="RadComboBox1" runat="server" Skin="WebBlue" MarkFirstMatch="true" Visible="false" AllowCustomText="true" Filter="StartsWith" CssClass="combo1" NoWrap="True" OnItemDataBound="RadComboBox1_ItemDataBound" AutoPostBack="True" OnSelectedIndexChanged="RadComboBox1_OnSelectedIndexChanged" OnClientDropDownOpened="ShowEmptyMessage" OnClientDropDownClosed="HideEmptyMessage" >
                    </telerik:RadComboBox>
                    <br />
                    <telerik:RadComboBox ID="RadComboBox2" runat="server" Skin="WebBlue" MarkFirstMatch="true" Visible="false" AllowCustomText="true" Filter="StartsWith" CssClass="combo2" NoWrap="True" OnItemDataBound="RadComboBox2_ItemDataBound" AutoPostBack="True" OnSelectedIndexChanged="RadComboBox2_OnSelectedIndexChanged" OnClientDropDownOpened="ShowEmptyMessage" OnClientDropDownClosed="HideEmptyMessage">
                    </telerik:RadComboBox>
                    <br />
                    <telerik:RadComboBox ID="RadComboBox3" runat="server" Skin="WebBlue" MarkFirstMatch="true" Visible="false" AllowCustomText="true" Filter="StartsWith" CssClass="combo3" NoWrap="True" OnItemDataBound="RadComboBox3_ItemDataBound" AutoPostBack="True" OnSelectedIndexChanged="RadComboBox3_OnSelectedIndexChanged" OnClientDropDownOpened="ShowEmptyMessage" OnClientDropDownClosed="HideEmptyMessage">
                    </telerik:RadComboBox>
                 </div>
 </telerik:RadAjaxPanel>

Panel with 2 panes
<telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" Height="100%" Width="100%">
          
            <telerik:RadSplitter ID="RadSplitter1" PanesBorderSize="0" BorderSize="0" runat="server" Orientation="Vertical" Width="99%" Height="109%">
                 
                <telerik:RadPane ID="RadPane1" runat="server" CssClass="MenuPane" MinWidth="220" Width="220px" Height="100%">
 
                    <telerik:RadSplitter ID="RadSplitter2" PanesBorderSize="0" BorderSize="0"  runat="server" ResizeWithParentPane="false" Orientation="Horizontal" Width="100%" Height="100%">
                 
                        <telerik:RadPane ID="RadPane3" runat="server" CssClass="MenuPane2" Width="100%" Height="50%">
              
                             <telerik:RadMenu ID="RadMenu2" runat="server" Visible="false" CssClass="menu3" OnItemClick="RadMenu_ItemClick" EnableImageSprites="true" BorderStyle="None" Flow="Vertical">
                
                             </telerik:RadMenu>
 
                         </telerik:RadPane>
 
 
                         <telerik:RadPane ID="RadPane4" runat="server" CssClass="MenuPane2" Width="100%" Height="50%">
 
                        <telerik:RadMenu ID="RadMenu3" runat="server" Visible="false" CssClass="menu3" OnItemClick="RadMenu_ItemClick" EnableImageSprites="true" BorderStyle="None" Flow="Vertical">
                              
                                 </telerik:RadMenu>
 
                          </telerik:RadPane>
 
                       </telerik:RadSplitter>
                 
                </telerik:RadPane>
 
              
                <telerik:RadPane ID="RadPane2" runat="server" CssClass="ContentPane" ContentUrl="Test.aspx">
                </telerik:RadPane>
                
            </telerik:RadSplitter>
        </telerik:RadAjaxPanel>


The function doing the magic is this one:
public void RefreshPanel(ref RadAjaxPanel rapPanel, ref RadPane rpPane, string strUrl, string strQuerystring)
        {
            rpPane.ContentUrl = strUrl + strQuerystring;
 
            WriteLog(rpPane.ContentUrl); //logging to check if code is called with right parameters
 
            rapPanel.RaisePostBackEvent(null);
        }

Everytime I check my log file (when refresh seemed to not occur), RaisePostBackEvent was called and ContentUrl of rpPane has the right value.

Is there a better way to do this, or any other property of rpPane/rapPanel I can check to find what could be wrong? Please help, this is killing me.

UPDATE: Can it be because im running the demo of the control (and sometimes get the "Thank you for using the Trial Version of RadControls for ASP.NET AJAX ..." message) and affect the post backs?

TIA
Maria Ilieva
Telerik team
 answered on 10 Oct 2012
1 answer
106 views
Greetings,

Is it possible to add the Grid Filter in the Header Section of the Grid instead of below the header in its own row?

IF that is not possible, is it possible to create a filter exactly like the one used in the Filter Row section? A filer that has the button with all the filtering options (Contains, Equals, Not Equal, etc....)

Or is it possible to eliminate the Header all together and just put the header in the Filter Section ?
Kostadin
Telerik team
 answered on 10 Oct 2012
4 answers
85 views
Hi,

Please take a look at the attaced pic, I can only display the percentage value (which is from the column "AverageScore" in the DataTable) on the column bar. I would like to add in some description label for each column (which is from the column "Description" in the same DataTable).

Is it possible to do it with HTMLChart? If not, What's about RadChart, is it possible to do so?

Thanks

Lamk
Rob
Top achievements
Rank 1
 answered on 10 Oct 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?