or
pvtCMStoG2.DataBind()Private Sub pvtCMStoG2_NeedDataSource(sender As Object, e As PivotGridNeedDataSourceEventArgs) Handles pvtCMStoG2.NeedDataSource 'Get an assign the data source. pvtCMStoG2.DataSource = GetPivotGridData()End SubPublic Function GetPivotGridData() As DataTable 'Decalre local variables. Dim myDataTable As New DataTable() 'Check to see if there is anything in Session for this. If Session("ReconciliationTime") IsNot Nothing Then 'Retrieve from session. myDataTable = CType(Session("ReconciliationTime"), DataTable) Else 'Set up the connection. Dim m_strConnectionString As [String] = ConfigurationManager.ConnectionStrings("SOREOConnection").ConnectionString Dim m_objConnection As New SqlConnection(m_strConnectionString) Dim m_objSQLCommand As New SqlCommand Dim m_cmdParameter As SqlParameter 'Set the command properties. With m_objSQLCommand .Connection = m_objConnection 'Set the command timeout value to wait indefinitely. .CommandTimeout = 0 'Set the core properties. .CommandText = "[reconciliation].[cspCMStoG2TimesheetValidation]" .CommandType = CommandType.StoredProcedure End With 'Create and set the parameter values. m_cmdParameter = New SqlParameter 'With {.ParameterName = "BeginDate", .SqlDbType = SqlDbType.DateTime} With m_cmdParameter .ParameterName = "@BeginDate" .SqlDbType = SqlDbType.DateTime 'Set the value. .Value = ctlBillingPeriodPicker.StartDate End With 'Add the parameter to the commands. m_objSQLCommand.Parameters.Add(m_cmdParameter) 'Create and set the parameter values. m_cmdParameter = New SqlParameter With m_cmdParameter .ParameterName = "@EndDate" .SqlDbType = SqlDbType.DateTime 'Set the value. .Value = ctlBillingPeriodPicker.EndDate End With 'Add the parameter to the commands. m_objSQLCommand.Parameters.Add(m_cmdParameter) 'Create and set the parameter values. m_cmdParameter = New SqlParameter With m_cmdParameter .ParameterName = "@EmployeeID" .SqlDbType = SqlDbType.UniqueIdentifier 'Set the value. If String.IsNullOrEmpty(ctlEmployeePicker.SelectedEmployeeID) Then .Value = System.DBNull.Value Else .Value = ctlEmployeePicker.SelectedEmployeeID End If End With 'Add the parameter to the commands. m_objSQLCommand.Parameters.Add(m_cmdParameter) 'Create and set the parameter values. m_cmdParameter = New SqlParameter With m_cmdParameter .ParameterName = "@CustomerID" .SqlDbType = SqlDbType.UniqueIdentifier 'Set the value. If String.IsNullOrEmpty(ctlCustomerPicker.SelectedCustomerID) Then .Value = System.DBNull.Value Else .Value = ctlCustomerPicker.SelectedCustomerID End If End With 'Add the parameter to the commands. m_objSQLCommand.Parameters.Add(m_cmdParameter) 'Create and set the parameter values. m_cmdParameter = New SqlParameter With m_cmdParameter .ParameterName = "@FundingAgency" .SqlDbType = SqlDbType.VarChar 'Set the value. If String.IsNullOrEmpty(ctlFundingOrganization.SelectedFundingOrganizationName) Then .Value = System.DBNull.Value Else .Value = ctlFundingOrganization.SelectedFundingOrganizationName End If End With 'Add the parameter to the commands. m_objSQLCommand.Parameters.Add(m_cmdParameter) 'Create and set the parameter values. m_cmdParameter = New SqlParameter With m_cmdParameter .ParameterName = "@TimesheetID" .SqlDbType = SqlDbType.Int 'Assign the value If chkSingleTimesheetID.Checked = True Then .Value = radTimesheetID.Value Else .Value = System.DBNull.Value End If End With 'Add the parameter to the commands. m_objSQLCommand.Parameters.Add(m_cmdParameter) 'Create and set the parameter values. m_cmdParameter = New SqlParameter With m_cmdParameter .ParameterName = "@IncludeLastImport" .SqlDbType = SqlDbType.Bit 'Assign the value .Value = chkIncludeLastImport.Checked End With 'Add the parameter to the commands. m_objSQLCommand.Parameters.Add(m_cmdParameter) 'Create and set the parameter values. m_cmdParameter = New SqlParameter With m_cmdParameter .ParameterName = "@ErrorsOnly" .SqlDbType = SqlDbType.Bit 'Assign the value .Value = chkErrorsOnly.Checked End With 'Add the parameter to the commands. m_objSQLCommand.Parameters.Add(m_cmdParameter) 'Set up the DataAdapter Dim DataAdapter As SqlDataAdapter = New SqlDataAdapter DataAdapter.SelectCommand = m_objSQLCommand Try 'Open the connection. m_objConnection.Open() 'Fill the data adapter. DataAdapter.Fill(myDataTable) Finally 'Close the connection. m_objConnection.Close() End Try 'Add it to the session. Session("ReconciliationTime") = myDataTable End If 'Return the final dataset. Return myDataTableEnd Function

<telerik:RadScriptManager ID="RadScriptManager1" runat="server" ScriptMode="Release"></telerik:RadScriptManager><telerik:RadAjaxLoadingPanel ID="LoadingPanel1" runat="server" Skin="Default"></telerik:RadAjaxLoadingPanel><telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
<AjaxSettings>
<telerik:AjaxSetting AjaxControlID="panel1">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="panel1" LoadingPanelID="LoadingPanel1" /> <telerik:AjaxUpdatedControl ControlID="grid1" />
<telerik:AjaxUpdatedControl ControlID="panel2" />
</UpdatedControls>
</telerik:AjaxSetting>
</AjaxSettings>
</telerik:RadAjaxManager><telerik:RadWindow ID="RadWindow1" runat="server" Title="Settings" Width="500px" Height="350px" OnClientClose="refreshGrid">
<ContentTemplate>
<asp:Panel ID="panel1" runat="server">
<telerik:RadAsyncUpload ID="AttachFiles" runat="server" InputSize="40" OnClientFileUploading="OnClientFileUploading" MultipleFileSelection="Automatic" OnClientValidationFailed="OnClientValidationFailed" MaxFileSize="73400320" AllowedFileExtensions=".jpeg,.jpg,.png,.docx,.doc,.xlsx,.xls,.pdf"> </telerik:RadAsyncUpload>
</asp:Panel>
</ContentTemplate>
</telerik:RadWindow>


<telerik:RadImageEditor ID="RadImageEditor1" runat="server" Visible="False" ToolBarMode="Docked"> </telerik:RadImageEditor>