Group by Resources in a RadSchedular

2 posts, 0 answers
  1. Vuyiswa Maseko
    Vuyiswa Maseko avatar
    187 posts
    Member since:
    Jan 2010

    Posted 23 Jun 2010 Link to this post

    Good Day all

    I have  a the Following query

    Declare @NumberOfSessions INT
    set @NumberOfSessions = (select [Sessions] from dbo.TBL_TTBL)

    SELECT   ID, Dy,  Sess,[Code],[Description],Description + '  Venue:'+ CAST(Venue AS VARCHAR) +' Student:'+ CAST(Students AS VARCHAR) +' StaffTerm:'+CAST(StaffTerm AS VARCHAR) + ' Term:'+ CAST(Term AS VARCHAR)  AS [SUBJECTS],Abrev,[Type],Number,
    group by dy,ID,Sess,[Code],[Description],Description,Abrev,[Type],Number,
    order by dy,sess

    i am binding this Data to the RadSchedular and the definition of my markup looks like this

      <telerik:RadScheduler ID="RadScheduler1" ColumnWidth="200px" RowHeaderWidth="200px" DayView-GroupingDirection="Vertical" RowHeaderHeight="400px"  runat="server" DataSourceID="SqlDataSource2"
                DataEndField="ENDDATE" DataKeyField="ID"  Skin="Telerik" Height="300px" Width="1600px" DataSubjectField="SUBJECTS"  DataStartField="STARTDATE" AllowDelete="False" AllowEdit="False" AllowInsert="False"   DayEndTime="20:00:00" DisplayRecurrenceActionDialogOnMove="True" OverflowBehavior="Expand" SelectedView="MonthView"  OnDataBound="RadScheduler1_DataBound" OnAppointmentCreated="RadScheduler1_AppointmentCreated" CssClass="ConfigurationPanel1" OnTimeSlotCreated="RadScheduler1_TimeSlotCreated" OnAppointmentDataBound="RadScheduler1_AppointmentDataBound">
                <MultiDayView UserSelectable="True"   ReadOnly="True" GroupBy="Venue" GroupingDirection="Vertical" />
                <DayView GroupingDirection="Vertical" />
                <Localization AdvancedDay="DY" />
                <telerik:ResourceType KeyField="Venue" Name="Venue" TextField="Venue" ForeignKeyField="Venue"
                DataSourceID="SqlDataSource2" />
    and my Datasource Controls is using a Sp and its defined like this

            <asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="Data Source=(local);Initial Catalog=oDirectv3;Persist Security Info=True;User ID=o;Password=abacus"
                SelectCommand="sp_Timetable_View" DeleteCommand="sp_Timetable_View" ProviderName="<%$ ConnectionStrings:DBConnectionString.ProviderName %>" DeleteCommandType="StoredProcedure" SelectCommandType="StoredProcedure" OnSelecting="SqlDataSource2_Selecting">
                    <asp:SessionParameter DefaultValue="" Name="selectionType" SessionField="viewOptions"
                        Type="String" />
                    <asp:SessionParameter DefaultValue="" Name="selectedItems" SessionField="selectedItems"
                        Type="String" />
                    <asp:SessionParameter DefaultValue="" Name="selectedTerms" SessionField="selectedTerms"
                        Type="String" />
                    <asp:Parameter Name="selectionType" Type="String" />
                    <asp:Parameter Name="selectedItems" Type="String" />
                    <asp:Parameter Name="selectedTerms" Type="String" />

    The Results from this datasource has all the fields i need to bind the Schedular. i have looked at the example in telerik site

    and here they have a different Datasource Control for Groupby, i am not sure why, but as you can see i have used the same DatasourceControl to Bind the Group by.

    Now my problem is that the Schedular does not show the Group by Resource as in the Example. I tried to use a second SQlDatasource for a group by sake, and i get an error that is not descriptive "Object not set for an instance of a Class"

    What is it i should put in mind while Doing the Group by

  2. Veronica
    Veronica avatar
    1213 posts

    Posted 25 Jun 2010 Link to this post

    Hi Vuyiswa Maseko,

    I've created a sample project to show you how to get resources and bind the RadScheduler to the same DataSource.

    Find the code in the attached .zip file.

    Hope this helps.

    Best wishes,
    Veronica Milcheva
    the Telerik team
    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 Public Issue Tracking system and vote to affect the priority of the items
  3. DevCraft R3 2016 release webinar banner
Back to Top