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,
GrpName,GrpNumber,Duration,[Students],
[Venue],Capacity,
[Staff],[ModlID],[Term]
,[StaffTerm]
,CAST(STARTDATE AS DATETIME) as [STARTDATE], CAST(ENDDATE AS DATETIME) AS [ENDDATE],[Length],CAST(@NumberOfSessions AS INT) as [Number_of_Sessions]
FROM
final_Timetable
group by dy,ID,Sess,[Code],[Description],Description,Abrev,[Type],Number,
GrpName,GrpNumber,Duration,[Students],
[Venue],Capacity,
[Staff],[ModlID],[Term]
,[StaffTerm],[STARTDATE],[ENDDATE],[Length]
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" />
<ResourceTypes>
<telerik:ResourceType KeyField="Venue" Name="Venue" TextField="Venue" ForeignKeyField="Venue"
DataSourceID="SqlDataSource2" />
</ResourceTypes>
</telerik:RadScheduler>
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">
<SelectParameters>
<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" />
</SelectParameters>
<DeleteParameters>
<asp:Parameter Name="selectionType" Type="String" />
<asp:Parameter Name="selectedItems" Type="String" />
<asp:Parameter Name="selectedTerms" Type="String" />
</DeleteParameters>
</asp:SqlDataSource>
The Results from this datasource has all the fields i need to bind the Schedular. i have looked at the example in telerik site http://demos.telerik.com/aspnet-ajax/scheduler/examples/timelineview/defaultcs.aspx
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
Thanks
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,
GrpName,GrpNumber,Duration,[Students],
[Venue],Capacity,
[Staff],[ModlID],[Term]
,[StaffTerm]
,CAST(STARTDATE AS DATETIME) as [STARTDATE], CAST(ENDDATE AS DATETIME) AS [ENDDATE],[Length],CAST(@NumberOfSessions AS INT) as [Number_of_Sessions]
FROM
final_Timetable
group by dy,ID,Sess,[Code],[Description],Description,Abrev,[Type],Number,
GrpName,GrpNumber,Duration,[Students],
[Venue],Capacity,
[Staff],[ModlID],[Term]
,[StaffTerm],[STARTDATE],[ENDDATE],[Length]
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" />
<ResourceTypes>
<telerik:ResourceType KeyField="Venue" Name="Venue" TextField="Venue" ForeignKeyField="Venue"
DataSourceID="SqlDataSource2" />
</ResourceTypes>
</telerik:RadScheduler>
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">
<SelectParameters>
<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" />
</SelectParameters>
<DeleteParameters>
<asp:Parameter Name="selectionType" Type="String" />
<asp:Parameter Name="selectedItems" Type="String" />
<asp:Parameter Name="selectedTerms" Type="String" />
</DeleteParameters>
</asp:SqlDataSource>
The Results from this datasource has all the fields i need to bind the Schedular. i have looked at the example in telerik site http://demos.telerik.com/aspnet-ajax/scheduler/examples/timelineview/defaultcs.aspx
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
Thanks