Error: Destination array is not long enough to copy all the items in the collection. Check array index and length.
<%
@ Page Language="VB" MasterPageFile="~/MasterPage.master" AutoEventWireup="false"
CodeFile="ClassPickNew.aspx.vb" Inherits="ClassPickNew" EnableViewStateMac="false"
EnableEventValidation="false" MaintainScrollPositionOnPostback="true" %>
<%
@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<%
@ Register Assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
Namespace="System.Web.UI" TagPrefix="asp" %>
<
asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
<
telerik:RadGrid ID="rgMain" Skin="Outlook2007" runat="server" AllowPaging="False"
AllowSorting="True" AllowMultiRowSelection="false" AutoGenerateColumns="False"
OnItemCommand="rgMain_ItemCommand" HorizontalAlign="NotSet" AllowAutomaticDeletes="False"
AllowAutomaticInserts="False" AllowAutomaticUpdates="false" Width="100%" AllowFilteringByColumn="false"
ShowGroupPanel="False">
<ClientSettings ReorderColumnsOnClient="True" AllowColumnsReorder="True" ApplyStylesOnClient="True">
<Scrolling AllowScroll="True" UseStaticHeaders="True" SaveScrollPosition="true" FrozenColumnsCount="1"
ScrollHeight="300px"></Scrolling>
<Resizing AllowRowResize="True" ClipCellContentOnResize="False" AllowColumnResize="True">
</Resizing>
</ClientSettings>
<MasterTableView DataKeyNames="ClassID" GridLines="None" AllowMultiColumnSorting="True"
AutoGenerateColumns="False" HorizontalAlign="NotSet" CommandItemDisplay="Top">
<GroupByExpressions>
<telerik:GridGroupByExpression>
<SelectFields>
<telerik:GridGroupByField FieldAlias="ClassDate" FieldName="ClassDate" FormatString="{0:D}"
HeaderText="Classes Offered"></telerik:GridGroupByField>
<telerik:GridGroupByField FieldAlias="StartTime" FieldName="StartTime" FormatString="{0:hh:mm tt}"
HeaderText=" "></telerik:GridGroupByField>
</SelectFields>
<GroupByFields>
<telerik:GridGroupByField FieldName="ClassDate" SortOrder="Ascending"></telerik:GridGroupByField>
<telerik:GridGroupByField FieldName="StartTime" SortOrder="Ascending"></telerik:GridGroupByField>
</GroupByFields>
</telerik:GridGroupByExpression>
</GroupByExpressions>
<Columns>
<telerik:GridBoundColumn HeaderText="ClassSchedulingID" DataField="ClassSchedulingID"
SortExpression="ClassSchedulingID" UniqueName="ClassSchedulingID" Display="False"
ReadOnly="True">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn UniqueName="SlotCode" SortExpression="SlotCode" HeaderText="SlotCode"
DataField="SlotCode" Display="False" ReadOnly="True">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn UniqueName="ClassTitleFull" SortExpression="ClassTitleFull"
HeaderText="Class" DataField="ClassTitleFull">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn UniqueName="ClassDate" SortExpression="ClassDate" HeaderText="ClassDate"
DataField="ClassDate" DataFormatString="{0:M/dd}">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn UniqueName="StartTime" SortExpression="StartTime" HeaderText="StartTime"
DataField="StartTime" DataFormatString="{0:hh:mm tt}">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="HandsOn" HeaderText="HandsOn" SortExpression="HandsOn"
UniqueName="HandsOn">
</telerik:GridBoundColumn>
<telerik:GridTemplateColumn UniqueName="Segment" HeaderText="Segment">
<ItemTemplate>
<%
--<asp:Label ID="lblSegment" runat="server"></asp:Label>--%>
</ItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridBoundColumn UniqueName="ClassFull" SortExpression="ClassFull" HeaderText="ClassFull"
DataField="ClassFull">
</telerik:GridBoundColumn>
<telerik:GridButtonColumn CommandName="Details" Text="Details" UniqueName="Details">
</telerik:GridButtonColumn>
<telerik:GridButtonColumn UniqueName="Select" Text="Select" CommandName="Select">
</telerik:GridButtonColumn>
</Columns>
<ExpandCollapseColumn ButtonType="ImageButton" Visible="true" UniqueName="ExpandColumn">
<HeaderStyle Width="19px"></HeaderStyle>
</ExpandCollapseColumn>
<RowIndicatorColumn ItemStyle-Width="0px" HeaderStyle-Width="0px" />
<CommandItemTemplate>
</CommandItemTemplate>
</MasterTableView>
</telerik:RadGrid>
</
asp:Content>
----------------------------------------------------Imports
System.Data.SqlClient
Imports
System.Data
Imports
Telerik.Web.UI
Sub
BindAvailableClasses()
Dim strConnection As String = ConfigurationManager.ConnectionStrings("MCHPEvents").ConnectionString
Dim cnMain As New SqlConnection(strConnection)
Try
Dim cmdMain As New SqlCommand("pr_Event_ListClassSchedulingInfo", cnMain)
cmdMain.CommandType = CommandType.StoredProcedure
cmdMain.Parameters.Clear()
cmdMain.Parameters.Add(
New SqlParameter("@EventTypeID", SqlDbType.Int))
cmdMain.Parameters(
"@EventTypeID").Value = oUser.EventID
'cmdMain.Parameters.Add(New SqlParameter("@SlotCode", SqlDbType.Int))
'cmdMain.Parameters("@SlotCode").Value = SlotCode
cmdMain.Parameters.Add(
New SqlParameter("@ReturnOnePerClassGroup", SqlDbType.Bit))
cmdMain.Parameters(
"@ReturnOnePerClassGroup").Value = 0
cmdMain.Parameters.Add(
New SqlParameter("@EventPart", SqlDbType.Int))
cmdMain.Parameters(
"@EventPart").Value = Convert.ToInt16(ConfigurationManager.AppSettings("MastersEventPart"))
Dim daMain As New SqlDataAdapter(cmdMain)
Dim dsMain As New DataSet
daMain.Fill(dsMain,
"Main")
rgMain.DataSource = dsMain.Tables(
"Main")
rgMain.DataMember =
"Main"
rgMain.DataBind()
Catch ex As SystemException
Finally
'Cleanup
If cnMain.State = ConnectionState.Open Then
cnMain.Close()
End If
cnMain.Dispose()
End Try
End Sub