This is a migrated thread and some comments may be shown as answers.

Please help me, radgrid displays the search result for the first time,but not from the second time onwards?

4 Answers 61 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Muhammed
Top achievements
Rank 1
Muhammed asked on 05 Jun 2012, 04:21 AM
<asp:Content ID="Content1" ContentPlaceHolderID="PageContent" runat="Server">
    <div class="rbcontent">
        <telerik:RadAjaxManager ID="RadAjaxManager1" EnableAJAX="true" runat="server">
            <AjaxSettings>
                <telerik:AjaxSetting AjaxControlID="btnReset">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="PnlCustomer" LoadingPanelID="LoadingPanel1" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
                <telerik:AjaxSetting AjaxControlID="btnReset">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="pnlSalesReport" LoadingPanelID="LoadingPanel1" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
                <telerik:AjaxSetting AjaxControlID="btnSearch">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="PnlCustomerGrid" LoadingPanelID="LoadingPanel1" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
                <telerik:AjaxSetting AjaxControlID="gvCustomer">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="PnlCustomerGrid" LoadingPanelID="LoadingPanel1" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
            </AjaxSettings>
        </telerik:RadAjaxManager>
 
 
        <telerik:RadAjaxLoadingPanel ID="LoadingPanel1" runat="server" Skin="Sunset">
        </telerik:RadAjaxLoadingPanel>
 
 
 
 
        <asp:Panel ID="PnlCustomer" runat="server" Visible="false">
            <table width="888" border="0" cellspacing="0" cellpadding="0">
                <tr>
                    <td class="Title" align="center">
                        Customer Reports
                    </td>
                </tr>
                <tr>
                    <td>
                          
                    </td>
                </tr>
                <tr>
                    <td>
                          
                    </td>
                </tr>
                <tr>
                    <td>
                        <table width="888" border="0" cellspacing="0" cellpadding="4">
                            <tr>
                                <td class="text18" width="180">
                                    Date of birth
                                </td>
                                <td width="10">
                                </td>
                                <td width="360">
                                    <telerik:RadComboBox ID="Cust_ddlday" EnableTextSelection="true" ChangeTextOnKeyBoardNavigation="true"
                                        Filter="StartsWith" CssClass="RadComboBoxFilter" MarkFirstMatch="true" runat="server"
                                        Width="60px">
                                        <Items>
                                            <telerik:RadComboBoxItem Text="DD" Value="" />
                                            <telerik:RadComboBoxItem Text="01" Value="01" />
                                            <telerik:RadComboBoxItem Text="02" Value="02" />
                                            <telerik:RadComboBoxItem Text="03" Value="03" />
                                            <telerik:RadComboBoxItem Text="04" Value="04" />
                                            <telerik:RadComboBoxItem Text="05" Value="05" />
                                            <telerik:RadComboBoxItem Text="06" Value="06" />
                                            <telerik:RadComboBoxItem Text="07" Value="07" />
                                            <telerik:RadComboBoxItem Text="08" Value="08" />
                                            <telerik:RadComboBoxItem Text="09" Value="09" />
                                            <telerik:RadComboBoxItem Text="10" Value="10" />
                                            <telerik:RadComboBoxItem Text="11" Value="11" />
                                            <telerik:RadComboBoxItem Text="12" Value="12" />
                                            <telerik:RadComboBoxItem Text="13" Value="13" />
                                            <telerik:RadComboBoxItem Text="14" Value="14" />
                                            <telerik:RadComboBoxItem Text="15" Value="15" />
                                            <telerik:RadComboBoxItem Text="16" Value="16" />
                                            <telerik:RadComboBoxItem Text="17" Value="17" />
                                            <telerik:RadComboBoxItem Text="18" Value="18" />
                                            <telerik:RadComboBoxItem Text="19" Value="19" />
                                            <telerik:RadComboBoxItem Text="20" Value="20" />
                                            <telerik:RadComboBoxItem Text="21" Value="21" />
                                            <telerik:RadComboBoxItem Text="22" Value="22" />
                                            <telerik:RadComboBoxItem Text="23" Value="23" />
                                            <telerik:RadComboBoxItem Text="24" Value="24" />
                                            <telerik:RadComboBoxItem Text="25" Value="25" />
                                            <telerik:RadComboBoxItem Text="26" Value="26" />
                                            <telerik:RadComboBoxItem Text="27" Value="27" />
                                            <telerik:RadComboBoxItem Text="28" Value="28" />
                                            <telerik:RadComboBoxItem Text="29" Value="29" />
                                            <telerik:RadComboBoxItem Text="30" Value="30" />
                                            <telerik:RadComboBoxItem Text="31" Value="31" />
                                        </Items>
                                    </telerik:RadComboBox>
                                     /
                                    <telerik:RadComboBox ID="Cust_ddlmonth" EnableTextSelection="true" ChangeTextOnKeyBoardNavigation="true"
                                        Filter="StartsWith" CssClass="RadComboBoxFilter" MarkFirstMatch="true" runat="server"
                                        Width="60px">
                                        <Items>
                                            <telerik:RadComboBoxItem Text="MM" Value="" />
                                            <telerik:RadComboBoxItem Text="Jan" Value="01" />
                                            <telerik:RadComboBoxItem Text="Feb" Value="02" />
                                            <telerik:RadComboBoxItem Text="Mar" Value="03" />
                                            <telerik:RadComboBoxItem Text="Apr" Value="04" />
                                            <telerik:RadComboBoxItem Text="May" Value="05" />
                                            <telerik:RadComboBoxItem Text="Jun" Value="06" />
                                            <telerik:RadComboBoxItem Text="Jul" Value="07" />
                                            <telerik:RadComboBoxItem Text="Aug" Value="08" />
                                            <telerik:RadComboBoxItem Text="Sep" Value="09" />
                                            <telerik:RadComboBoxItem Text="Oct" Value="10" />
                                            <telerik:RadComboBoxItem Text="Nov" Value="11" />
                                            <telerik:RadComboBoxItem Text="Dec" Value="12" />
                                        </Items>
                                    </telerik:RadComboBox>
                                     /
                                    <telerik:RadComboBox ID="Cust_ddl_year" EnableTextSelection="true" ChangeTextOnKeyBoardNavigation="true"
                                        Filter="StartsWith" CssClass="RadComboBoxFilter" MarkFirstMatch="true" runat="server"
                                        Width="60px">
                                    </telerik:RadComboBox>
                                </td>
                            </tr>
                            <tr>
                                <td class="text18" width="180">
                                    Gender
                                </td>
                                <td width="10">
                                </td>
                                <td width="360">
                                    <telerik:RadComboBox ID="Cust_ddl_Gender" DataTextField="Descp" DataValueField="Refcd"
                                        runat="server">
                                    </telerik:RadComboBox>
                                </td>
                            </tr>
                            <tr>
                                <td class="text18" width="180">
                                    Marital Status
                                </td>
                                <td width="10">
                                </td>
                                <td width="360">
                                    <telerik:RadComboBox ID="Cust_ddl_Marital" runat="server" DataTextField="Descp" DataValueField="Refcd">
                                    </telerik:RadComboBox>
                                </td>
                            </tr>
                            <tr>
                                <td class="text18" width="180">
                                    Card Collection
                                </td>
                                <td width="10">
                                </td>
                                <td width="360">
                                    <telerik:RadComboBox ID="Cust_ddl_CardCollection" runat="server" DataTextField="Descp"
                                        DataValueField="Refcd">
                                    </telerik:RadComboBox>
                                </td>
                            </tr>
                            <tr>
                                <td class="text18" width="180">
                                    Nationality
                                </td>
                                <td width="10">
                                </td>
                                <td width="360">
                                    <telerik:RadComboBox ID="Cust_ddl_Nationality" EnableTextSelection="true" ChangeTextOnKeyBoardNavigation="true"
                                        Filter="StartsWith" CssClass="RadComboBoxFilter" MarkFirstMatch="true" runat="server"
                                        DataTextField="Descp" DataValueField="Refcd">
                                    </telerik:RadComboBox>
                                </td>
                            </tr>
                            <tr>
                                <td class="text18" width="180">
                                    Preferred Communication
                                </td>
                                <td width="10">
                                </td>
                                <td width="360">
                                    <asp:CheckBoxList ID="CUST_chk_PrefComm" RepeatDirection="Horizontal" RepeatLayout="Table"
                                        DataTextField="Descp" DataValueField="Refcd" runat="server" BorderStyle="None">
                                    </asp:CheckBoxList>
                                </td>
                            </tr>
                            <tr>
                                <td class="text18" width="180">
                                    Personal Interest
                                </td>
                                <td width="10">
                                </td>
                                <td width="360">
                                    <asp:CheckBoxList ID="Cust_Chk_Interests" RepeatDirection="Horizontal" RepeatColumns="4"
                                        RepeatLayout="Table" DataTextField="Descp" DataValueField="Refcd" runat="server"
                                        BorderStyle="None">
                                    </asp:CheckBoxList>
                                </td>
                            </tr>
                            <tr>
                                <td class="text18" width="180">
                                    Annual Income
                                </td>
                                <td width="10">
                                </td>
                                <td width="360">
                                    <telerik:RadComboBox ID="Cust_ddl_Income" CssClass="text09" DataTextField="Descp"
                                        DataValueField="Refcd" runat="server">
                                    </telerik:RadComboBox>
                                </td>
                            </tr>
                            <tr>
                                <td class="text18" width="180">
                                    Occupation
                                </td>
                                <td width="10">
                                </td>
                                <td width="360">
                                    <telerik:RadComboBox ID="Cust_ddl_Occupation" DataTextField="Descp" DataValueField="Refcd"
                                        runat="server">
                                    </telerik:RadComboBox>
                                </td>
                            </tr>
                        </table>
                    </td>
                </tr>
            </table>
            <table width="700" border="0" cellspacing="0" cellpadding="4">
                <tr>
                    <td class="text18" style="width: 212px">
                        Point Range
                    </td>
                    <td class="text18" style="width: 87px">
                                   From
                    </td>
                    <td>
                        <telerik:RadNumericTextBox ID="txtPntFrom" CssClass="text09" runat="server" NumberFormat-DecimalDigits="0">
                        </telerik:RadNumericTextBox>
                    </td>
                    <td class="text18">
                        To
                    </td>
                    <td>
                        <telerik:RadNumericTextBox ID="txtPntTo" runat="server" NumberFormat-DecimalDigits="0">
                        </telerik:RadNumericTextBox>
                    </td>
                </tr>
                <%--<tr>
                <td class="text18"><asp:Label ID="lbl1" runat="server"></asp:Label></td>
                <td><asp:Label ID="Lbl2" runat="server"></asp:Label></td>
                </tr>--%>
            </table>
        </asp:Panel>
        <asp:Panel ID="pnlButton" runat="server">
            <table cellpadding="10" cellspacing="10" border="0">
                <tr>
                    <td style="width: 290px">
                          
                    </td>
                    <td>
                        <asp:ImageButton ID="btnSearch" runat="server" ImageUrl="~/images_latest/btnSearch.png" />
                    </td>
                    <td style="width: 38px">
                        <asp:ImageButton ID="btnReset" runat="server" ImageUrl="images_latest/11.png" />
                    </td>
                    <td style="width: 32px">
                        <asp:ImageButton ID="btnXlsXport" ValidationGroup="Export" ToolTip="Download the table in Excel(XLS) format"
                            runat="server" ImageUrl="~/images_latest/btnSave.png" />
                    </td>
                </tr>
            </table>
            <table cellpadding="0" cellspacing="2" border="0">
                <tr>
                    <td style="width: 29%">
                          
                    </td>
                    <td style="width: 294px">
                    </td>
                    <td style="width: 37%" align="right">
                          
                    </td>
                </tr>
            </table>
        </asp:Panel>
        <asp:Panel runat="server" ID="PnlCustomerGrid">
            <table cellpadding="0" cellspacing="0" border="0" class="tblGridView">
                <tr>
                    <td colspan="2" class="tdGridview">
                        <telerik:RadGrid ID="gvCustomer" CssClass="AddBorders"  runat="server" Width="888px"
                            AutoGenerateColumns="False" ShowDesignTimeSmartTagMessage="False" HeaderStyle-HorizontalAlign="Center"
                            AllowPaging="True" AllowSorting="True" Skin="Sunset" GridLines="None">
                            <PagerStyle Mode="NextPrevAndNumeric" />
                            <ClientSettings ReorderColumnsOnClient="True" AllowColumnsReorder="True" ColumnsReorderMethod="Reorder"
                                EnableRowHoverStyle="true">
                                <Resizing AllowColumnResize="true" />
                            </ClientSettings>
                            <GroupingSettings CaseSensitive="false" />
                            <MasterTableView TableLayout="Fixed">
                                <Columns>
                                    <telerik:GridBoundColumn HeaderText="Card No" DataField="CardNo" UniqueName="CardNo"
                                        SortExpression="CardNo" HeaderStyle-Width="150px" AllowFiltering="true" FilterDelay="4000"
                                        FilterControlWidth="145px" AutoPostBackOnFilter="false" CurrentFilterFunction="Contains">
                                        <HeaderStyle Width="150px" />
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="Familyname" HeaderText="Name" UniqueName="Name"
                                        CurrentFilterFunction="Contains" FilterControlWidth="97" ShowFilterIcon="false"
                                        HeaderStyle-Width="100px" SortExpression="FamilyName">
                                        <HeaderStyle Width="100px" />
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="EmailAddr" UniqueName="EmailAddr" HeaderText="Email ID"
                                        CurrentFilterFunction="Contains" FilterControlWidth="137" FilterDelay="4000"
                                        ShowFilterIcon="false" HeaderStyle-Width="100px" SortExpression="EmailAddr">
                                        <HeaderStyle Width="140px" />
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="MobileNo" UniqueName="MobileNo" HeaderText="Contact No"
                                        CurrentFilterFunction="Contains" FilterControlWidth="137" ShowFilterIcon="false"
                                        HeaderStyle-Width="100px" SortExpression="MobileNo">
                                        <HeaderStyle Width="140px" />
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="Address" UniqueName="Address" AllowFiltering="false"
                                        HeaderText="Address" CurrentFilterFunction="Contains" ShowFilterIcon="false"
                                        HeaderStyle-Width="200px" SortExpression="Address">
                                        <HeaderStyle Width="200px" />
                                    </telerik:GridBoundColumn>
                                    <telerik:GridDateTimeColumn DataField="MemberSince" UniqueName="MemberSince" FilterControlWidth="97"
                                        HeaderText="Member Since" CurrentFilterFunction="Contains" ShowFilterIcon="false"
                                        HeaderStyle-Width="100px" DataFormatString="{0:MMMM dd, yyyy}" SortExpression="MemberSince">
                                        <HeaderStyle Width="100px" />
                                    </telerik:GridDateTimeColumn>
                                </Columns>
                            </MasterTableView>
                            <ExportSettings FileName="CustomerReport">
                            </ExportSettings>
                            <ClientSettings AllowColumnsReorder="True" ReorderColumnsOnClient="True">
                                <Scrolling AllowScroll="True" UseStaticHeaders="True" />
                            </ClientSettings>
                            <HeaderStyle HorizontalAlign="Center" />
                        </telerik:RadGrid>
                    </td>
                </tr>
            </table>
            <table>
            </table>
        </asp:Panel>
        <table>
            <tr>
                <td>
                      
                </td>
            </tr>
            <tr>
                <td>
                      
                </td>
            </tr>
        </table>
    </div>
</asp:Content>
 
=============================================================================
 
Search click event contains these lines of code
 
 Protected Sub btnSearch_Click(ByVal sender As Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles btnSearch.Click
        gvCustomer.DataSource = Nothing
        objSQLDataClient = New SQLDataClient
        dtReport = GenerateCustomerReportTable()
        PnlCustomerGrid.Visible = True
        dtGrdSrc = objSQLDataClient.SearchCustomer(dtReport)
        Session("GridSrc") = dtGrdSrc
        gvCustomer.DataSource = dtGrdSrc
        gvCustomer.DataBind()
 
 
    End Sub
 
 
 Protected Sub gvCustomer_NeedDataSource(ByVal source As Object, ByVal e As Telerik.Web.UI.GridNeedDataSourceEventArgs) Handles gvCustomer.NeedDataSource
        PnlCustomerGrid.Visible = True
        dtGrdSrc = CType(Session("GridSrc"), DataTable)
        gvCustomer.DataSource = dtGrdSrc
    End Sub
 
 
========================================================================
 
 
so now why is the grid displays data on the first search and not from the second onwards? the ajaxloadingpanel just keeps loading on the gird. There are three pages very similar to this and all have the same problem. I linked the page to a master page which contains the asp script manager along with a loading panel.
 
please help me findout the issue here?i'm about to cross my deadline.

4 Answers, 1 is accepted

Sort by
0
Muhammed
Top achievements
Rank 1
answered on 05 Jun 2012, 04:30 AM
Dear Telerik,
Here is my codebehind incase if you need, thank you.


Partial Class CustomerReports
    Inherits CustBaseClass
    Private DropDown() As String
    Private objSQLDataClient As SQLDataClient
    Private dsDropDown As DataSet
    Private dtReport As New DataTable
    Private dtGrdSrc As DataTable




    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        If Not IsPostBack = True Then
            Session("GridSrc") = Nothing
            PnlCustomer.Visible = True
            PnlCustomerGrid.Visible = True
            gvCustomer.DataSource = New Integer() {}
            BindYear()
            LoadDropDown()


        End If
    End Sub


    Private Sub BindYear()
        Dim year As Integer = Now.Year
        Dim item As RadComboBoxItem
        For i As Integer = 1930 To year
            item = New RadComboBoxItem
            item.Text = i.ToString
            item.Value = i.ToString
            Cust_ddl_year.Items.Add(item)
        Next
        Cust_ddl_year.Items(0).Text = "YYYY"
        Cust_ddl_year.Items(0).Value = ""
    End Sub


    Private Sub LoadDropDown()
        dsDropDown = New DataSet
        objSQLDataClient = New SQLDataClient


        dsDropDown = objSQLDataClient.FillDropDown("Marital", 1, , , )
        Cust_ddl_Marital.DataSource = dsDropDown.Tables(0)
        Cust_ddl_Marital.DataBind()
        dsDropDown.Tables.Clear()
        With Cust_ddl_Gender
            dsDropDown = objSQLDataClient.FillDropDown("Gender", 1, , , )
            .DataSource = dsDropDown.Tables(0)
            .DataBind()
            dsDropDown.Tables.Clear()
        End With
        With Cust_ddl_CardCollection
            dsDropDown = objSQLDataClient.FillDropDown("CardCollection", 1, , )
            .DataSource = dsDropDown.Tables(0)
            .DataBind()
            dsDropDown.Tables(0).Clear()
        End With
        With Cust_ddl_Nationality
            dsDropDown = objSQLDataClient.FillDropDown("Nationality", 1, , , )
            .DataSource = dsDropDown.Tables(0)
            .DataBind()
            dsDropDown.Tables.Clear()
        End With
        With CUST_chk_PrefComm
            dsDropDown = objSQLDataClient.FillDropDown("PrefCommunication", 1, , , )
            .DataSource = dsDropDown.Tables(0)
            .DataBind()
            dsDropDown.Tables.Clear()
        End With
        dsDropDown = objSQLDataClient.FillDropDown("Interest", 1, , , )
        Cust_Chk_Interests.DataSource = dsDropDown.Tables(0)
        Cust_Chk_Interests.DataBind()
        dsDropDown.Tables.Clear()
        With Cust_ddl_Income
            dsDropDown = objSQLDataClient.FillDropDown("AnnualIncome", 1, , , )
            .DataSource = dsDropDown.Tables(0)
            .DataBind()
            dsDropDown.Tables.Clear()
        End With
        With Cust_ddl_Occupation
            dsDropDown = objSQLDataClient.FillDropDown("Occupation", 1, , , )
            .DataSource = dsDropDown.Tables(0)
            .DataBind()
            dsDropDown.Tables.Clear()
        End With
    End Sub
    Private Function GenerateCustomerReportTable() As DataTable
        Dim dt As New DataTable
        Dim dc As DataColumn
        Dim drRow As DataRow
        Dim i As Integer
        Dim sum As Integer = 0


        With dt
            dc = New DataColumn("DOBDay", Type.GetType("System.String"))
            .Columns.Add(dc)
            dc = New DataColumn("DOBMonth", Type.GetType("System.String"))
            .Columns.Add(dc)
            dc = New DataColumn("DOBYear", Type.GetType("System.String"))
            .Columns.Add(dc)
            dc = New DataColumn("Gender", Type.GetType("System.String"))
            .Columns.Add(dc)
            dc = New DataColumn("Marital", Type.GetType("System.String"))
            .Columns.Add(dc)
            dc = New DataColumn("CardCollection", Type.GetType("System.String"))
            .Columns.Add(dc)
            dc = New DataColumn("Nationality", Type.GetType("System.String"))
            .Columns.Add(dc)
            dc = New DataColumn("PrefCommunication", Type.GetType("System.String"))
            .Columns.Add(dc)


            dc = New DataColumn("Interest", Type.GetType("System.String"))
            .Columns.Add(dc)


            dc = New DataColumn("AnnualIncome", Type.GetType("System.String"))
            .Columns.Add(dc)


            dc = New DataColumn("Occupation", Type.GetType("System.String"))
            .Columns.Add(dc)


            dc = New DataColumn("PointsFrom", Type.GetType("System.String"))
            .Columns.Add(dc)
            dc = New DataColumn("PointsTo", Type.GetType("System.String"))
            .Columns.Add(dc)
        End With


        drRow = dt.NewRow


        If Cust_ddlday.SelectedIndex <> 0 Then
            drRow.Item("DOBDAY") = Cust_ddlday.SelectedValue
        End If


        If Cust_ddlmonth.SelectedIndex <> 0 Then
            drRow.Item("DOBMonth") = Cust_ddlmonth.SelectedValue
        End If


        If Cust_ddl_year.SelectedIndex <> 0 Then
            drRow.Item("DOBYear") = Cust_ddl_year.SelectedValue
        End If




        If Cust_ddl_Gender.SelectedValue <> String.Empty Then
            drRow.Item("Gender") = Cust_ddl_Gender.SelectedValue.ToString
        End If


        If Cust_ddl_Marital.SelectedValue <> String.Empty Then
            drRow.Item("Marital") = Cust_ddl_Marital.SelectedValue.ToString
        End If


        If Cust_ddl_CardCollection.SelectedValue <> String.Empty Then
            drRow.Item("CardCollection") = Cust_ddl_CardCollection.SelectedValue.ToString
        End If


        If Cust_ddl_Nationality.SelectedValue <> String.Empty Then
            drRow.Item("Nationality") = Cust_ddl_Nationality.SelectedValue.ToString
        End If
        For i = 0 To CUST_chk_PrefComm.Items.Count - 1
            If CUST_chk_PrefComm.Items(i).Selected = True Then
                sum += CType(CUST_chk_PrefComm.Items(i).Value, Integer)
            End If
        Next
        If sum <> 0 Then
            drRow.Item("PrefCommunication") = sum.ToString
        End If
        sum = 0


        For i = 0 To Cust_Chk_Interests.Items.Count - 1
            If Cust_Chk_Interests.Items(i).Selected = True Then
                sum += CType(Cust_Chk_Interests.Items(i).Value, Integer)
            End If
        Next
        If sum <> 0 Then
            drRow.Item("Interest") = sum.ToString
        End If


        sum = 0


        If Cust_ddl_Income.SelectedValue <> String.Empty Then
            drRow.Item("AnnualIncome") = Cust_ddl_Income.SelectedValue.ToString
        End If


        If Cust_ddl_Occupation.SelectedValue <> String.Empty Then
            drRow.Item("Occupation") = Cust_ddl_Occupation.SelectedValue.ToString
        End If


        If txtPntFrom.Text <> "" Then
            drRow.Item("PointsFrom") = txtPntFrom.Text
        End If
        If txtPntTo.Text <> "" Then
            drRow.Item("PointsTo") = txtPntTo.Text
        End If


        dt.Rows.Add(drRow)
        dt.AcceptChanges()
        Return dt
    End Function
    Protected Sub btnSearch_Click(ByVal sender As Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles btnSearch.Click
        gvCustomer.DataSource = New Integer() {}
        objSQLDataClient = New SQLDataClient
        dtReport = GenerateCustomerReportTable()
        PnlCustomerGrid.Visible = True
        dtGrdSrc = objSQLDataClient.SearchCustomer(dtReport)
        Session("GridSrc") = dtGrdSrc
        gvCustomer.DataSource = dtGrdSrc
        gvCustomer.DataBind()


    End Sub
    Protected Sub btnXlsXport_Click(ByVal sender As Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles btnXlsXport.Click
        
                gvCustomer.ExportSettings.ExportOnlyData = True
                gvCustomer.ExportSettings.IgnorePaging = True
                gvCustomer.MasterTableView.GetColumn("Name").HeaderStyle.BackColor = Drawing.Color.Gold
                gvCustomer.MasterTableView.GetColumn("Name").HeaderStyle.Width = Unit.Pixel(150)
                gvCustomer.MasterTableView.GetColumn("Address").HeaderStyle.Width = Unit.Pixel(300)
                gvCustomer.MasterTableView.GetColumn("EmailAddr").HeaderStyle.Width = Unit.Pixel(250)
                gvCustomer.MasterTableView.GetColumn("MobileNo").HeaderStyle.Width = Unit.Pixel(250)
                gvCustomer.MasterTableView.GetColumn("MemberSince").HeaderStyle.Width = Unit.Pixel(140)
                gvCustomer.MasterTableView.ExportToExcel()


    End Sub




    Protected Sub btnReset_Click(ByVal sender As Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles btnReset.Click
        
                check(PnlCustomer)
    End Sub




    Protected Sub Cust_ddl_Marital_DataBound(ByVal sender As Object, ByVal e As System.EventArgs) Handles Cust_ddl_Marital.DataBound
        Dim combo As RadComboBox = DirectCast(sender, RadComboBox)
        combo.Items.Insert(0, New RadComboBoxItem("", ""))
    End Sub


    Protected Sub Cust_ddl_Gender_DataBound(ByVal sender As Object, ByVal e As System.EventArgs) Handles Cust_ddl_Gender.DataBound
        Dim combo As RadComboBox = DirectCast(sender, RadComboBox)
        combo.Items.Insert(0, New RadComboBoxItem("", ""))
    End Sub


    Protected Sub Cust_ddl_CardCollection_DataBound(ByVal sender As Object, ByVal e As System.EventArgs) Handles Cust_ddl_CardCollection.DataBound
        Dim combo As RadComboBox = DirectCast(sender, RadComboBox)
        combo.Items.Insert(0, New RadComboBoxItem("", ""))
    End Sub


    Protected Sub Cust_ddl_Nationality_DataBound(ByVal sender As Object, ByVal e As System.EventArgs) Handles Cust_ddl_Nationality.DataBound
        Dim combo As RadComboBox = DirectCast(sender, RadComboBox)
        combo.Items.Insert(0, New RadComboBoxItem("", ""))
    End Sub


    Protected Sub Cust_ddl_Income_DataBound(ByVal sender As Object, ByVal e As System.EventArgs) Handles Cust_ddl_Income.DataBound
        Dim combo As RadComboBox = DirectCast(sender, RadComboBox)
        combo.Items.Insert(0, New RadComboBoxItem("", ""))
    End Sub


    Protected Sub Cust_ddl_Occupation_DataBound(ByVal sender As Object, ByVal e As System.EventArgs) Handles Cust_ddl_Occupation.DataBound
        Dim combo As RadComboBox = DirectCast(sender, RadComboBox)
        combo.Items.Insert(0, New RadComboBoxItem("", ""))
    End Sub


    Protected Sub gvCustomer_NeedDataSource(ByVal source As Object, ByVal e As Telerik.Web.UI.GridNeedDataSourceEventArgs) Handles gvCustomer.NeedDataSource
        PnlCustomerGrid.Visible = True
        dtGrdSrc = CType(Session("GridSrc"), DataTable)
        gvCustomer.DataSource = dtGrdSrc
    End Sub
    Private Sub check(ByVal pnl As Panel)
        Dim cmb As RadComboBox
        Dim txt As RadNumericTextBox
        Dim chk As CheckBoxList


        For Each oControl As Control In pnl.Controls
            If TypeOf oControl Is RadComboBox Then
                cmb = CType(oControl, RadComboBox)
                cmb.SelectedIndex = 0
            ElseIf TypeOf oControl Is RadNumericTextBox Then
                txt = CType(oControl, RadNumericTextBox)
                txt.Text = String.Empty
            ElseIf TypeOf oControl Is CheckBoxList Then
                chk = CType(oControl, CheckBoxList)
                For i As Integer = 0 To chk.Items.Count - 1
                    chk.Items(i).Selected = False
                Next
            End If
        Next
    End Sub
    Protected Sub gvCustomer_ExcelExportCellFormatting(ByVal source As Object, ByVal e As Telerik.Web.UI.ExcelExportCellFormattingEventArgs) Handles gvCustomer.ExcelExportCellFormatting
        e.Cell.HorizontalAlign = HorizontalAlign.Left
        ' e.Cell.Height = Unit.Pixel(30)
        If e.FormattedColumn.UniqueName = "MobileNo" Then
            e.Cell.Style("mso-number-format") = "0000"
        End If
    End Sub




End Class

0
Muhammed
Top achievements
Rank 1
answered on 05 Jun 2012, 04:45 AM
okay so when i remove the search buttom from ajax setting and allow the page to make a roundtrip, the gird is able to populate even after the first time. so i guess the problem with the ajax manager?
0
Muhammed
Top achievements
Rank 1
answered on 05 Jun 2012, 04:54 AM
its not the grid alone, its happening to all the ajax updated controls.what is the problem?
0
Muhammed
Top achievements
Rank 1
answered on 05 Jun 2012, 05:25 PM
Its the masterpage, causing the problem.i need to put the RadajaxManager in the master page as well and then call it from the content page somehow, i couldnt understand it.
i thought telerik support is terrific and took my time to write this thread. i hoped the whole day that telerik would reply, and i was disappointed....


Tags
Grid
Asked by
Muhammed
Top achievements
Rank 1
Answers by
Muhammed
Top achievements
Rank 1
Share this question
or