Radscheduler Grouping : Group Repeating

3 posts, 0 answers
  1. Prashant
    Prashant avatar
    4 posts
    Member since:
    Jul 2015

    Posted 29 Jul 2015 Link to this post

    hiii,

    I have created an application For grouping. i am accessing data from 4 tables in one datatable by performing union

    and seperating them by adding one extra column of tablenames.

    and i want to display that 4 tables in 4 groups.

    It is showing it clearly when each table have only one row.

    but when i insert new row in any of 4 table then 2 groups are created for that table.

     Please help me to solve this problem.

     

    i have attached data that im fetching from db and image of result

     

    please reply me

  2. Prashant
    Prashant avatar
    4 posts
    Member since:
    Jul 2015

    Posted 29 Jul 2015 Link to this post

    Following is the code that im using 

     

     

    <telerik:RadScheduler runat="server" ID="RadScheduler1" DataSourceID="AppointmentsDataSource"
                SelectedView="MonthView" OverflowBehavior="Auto" OnAppointmentInsert="RadScheduler1_AppointmentInsert"
                DataKeyField="ID" DataStartField="​StartDate" DataEndField="​EndDate" DataSubjectField="Subject" OnAppointmentCommand="RadScheduler1_AppointmentCommand" OnAppointmentDataBound="RadScheduler1_AppointmentDataBound"
                DataRecurrenceField="RecurrenceRule" DataRecurrenceParentKeyField="RecurrenceParentID"
                DataReminderField="Reminder" Skin="Sunset" OnClientAppointmentResizeStart="OnClientAppointmentResizeStart" OnClientAppointmentResizing="OnClientAppointmentResizing" OnClientAppointmentResizeEnd="OnClientAppointmentResizeEnd" DataDescriptionField="Description" EnableDescriptionField="true"
                 OnTimeSlotContextMenuItemClicking="RadScheduler1_TimeSlotContextMenuItemClicking">
                <ExportSettings>
                    <Pdf PageTopMargin="1in" PageBottomMargin="1in" PageLeftMargin="1in" PageRightMargin="1in"></Pdf>
                </ExportSettings>

                <AdvancedForm Modal="true"></AdvancedForm>
                <Reminders Enabled="true"></Reminders>

                <TimeSlotContextMenuSettings EnableDefault="true"></TimeSlotContextMenuSettings>
                <AppointmentContextMenuSettings EnableDefault="true"></AppointmentContextMenuSettings>

                <AppointmentTemplate>
                    <div class="appointmentHeader">
                        <%# Eval("Subject") %>

                    </div>

                </AppointmentTemplate>

                <AppointmentContextMenus>

                    <telerik:RadSchedulerContextMenu runat="server" ID="SchedulerAppointmentContextMenu">
                        <Items>

                            <telerik:RadMenuItem Text="Categorize">
                                <Items>
                                    <telerik:RadMenuItem  Text="Process" Value="Process">
                                    </telerik:RadMenuItem>
                                    <telerik:RadMenuItem Text="Entity" Value="Entity">
                                    </telerik:RadMenuItem>
                                    <telerik:RadMenuItem Text="Action" Value="Action">
                                    </telerik:RadMenuItem>
                                    <telerik:RadMenuItem Text="Plan" Value="Plan">
                                    </telerik:RadMenuItem>
                                </Items>
                            </telerik:RadMenuItem>


                        </Items>
                    </telerik:RadSchedulerContextMenu>
                </AppointmentContextMenus>
                <TimeSlotContextMenus>
                    <telerik:RadSchedulerContextMenu runat="server" ID="SchedulerTimeSlotContextMenu">
                        <Items>


                            <telerik:RadMenuItem Text="Group by Calendar" Value="EnableGrouping">
                            </telerik:RadMenuItem>
                            <telerik:RadMenuItem IsSeparator="true">
                            </telerik:RadMenuItem>
                            <telerik:RadMenuItem Text="Go to today" Value="CommandGoToToday">
                            </telerik:RadMenuItem>
                        </Items>
                    </telerik:RadSchedulerContextMenu>
                </TimeSlotContextMenus>
                <ResourceTypes>
                    <telerik:ResourceType KeyField="Type" Name="Type" TextField="Type" ForeignKeyField="Type"
                        DataSourceID="AppointmentsDataSource"></telerik:ResourceType>
                </ResourceTypes>
                <ResourceStyles>
                    <telerik:ResourceStyleMapping Type="Type" Text="Process" ApplyCssClass="rsCategoryBlue"></telerik:ResourceStyleMapping>
                    <telerik:ResourceStyleMapping Type="Type" Text="Action" ApplyCssClass="rsCategoryOrange"></telerik:ResourceStyleMapping>
                    <telerik:ResourceStyleMapping Type="Type" Text="Entity" ApplyCssClass="rsCategoryGreen"></telerik:ResourceStyleMapping>
                    <telerik:ResourceStyleMapping Type="Type" Text=" Plan" ApplyCssClass="rsCategoryRed"></telerik:ResourceStyleMapping>
                </ResourceStyles>
            </telerik:RadScheduler>

            <asp:sqldatasource id="AppointmentsDataSource" runat="server" providername="MySql.Data.MySqlClient" connectionstring="<%$ ConnectionStrings:constr %>"
                selectcommand="SELECT * FROM testview">

            </asp:sqldatasource>

     

     ///// Code Behind

     

    protected override void OnPreRender(EventArgs e)
        {
            // "Group By Calendar" context menu item
            RadMenuItem menuItem = RadScheduler1.TimeSlotContextMenus[0].Items[0];

            if (String.IsNullOrEmpty(RadScheduler1.GroupBy))
            {
                menuItem.Text = "Group by Calendar";
                menuItem.Value = "EnableGrouping";
            }
            else
            {
                menuItem.Text = "Disable Grouping";
                menuItem.Value = "DisableGrouping";
            }
            base.OnPreRender(e);
        }

     

     

     protected void RadScheduler1_TimeSlotContextMenuItemClicking(object sender, TimeSlotContextMenuItemClickingEventArgs e)
        {
            if (e.MenuItem.Value == "EnableGrouping")
            {
                RadScheduler1.GroupBy = "ReminderType";
                
            }
            else if (e.MenuItem.Value == "DisableGrouping")
            {
                RadScheduler1.GroupBy = "";
            }
        }​​

     

     

     

  3. Bozhidar
    Admin
    Bozhidar avatar
    1124 posts

    Posted 03 Aug 2015 Link to this post

    Hello,

    You have to define your resources in a separate Table, with a corresponding separate datasource, where each resource gets a uniquie ID. Please refer to the following demo for a preview of what the code should look like:
    http://demos.telerik.com/aspnet-ajax/scheduler/examples/resources/defaultcs.aspx

    Regards,
    Bozhidar
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top