RadAjaxManager not updating controls

3 posts, 0 answers
  1. Scott
    Scott avatar
    5 posts
    Member since:
    Dec 2010

    Posted 02 Feb 2011 Link to this post

    I am trying to updated a RadGrid based on what is selected in a RadComboBox but the grid displays nothing.  The Grid's SQL DataSource is tied to a stored procedure which accepts a parameter (CustBill) from the RadComboBox.  Ajax Manager is setup to update both the RadGrid and RadComboBox but the stored procedure returns 0 results no matter what is selected in the combo box.  Here is the AjaxManager, RadComboBox, and SQL Datasource code.  Is AjaxManager refreshing the controls properly?  Your help is appreciated. 
    -Scott

     

     

    ***
    <
    telerik:RadAjaxManager ID="RadAjaxManager1" runat="server"

     

     

     

    DefaultLoadingPanelID="RadAjaxLoadingPanel1">

     

     

     

      <AjaxSettings>

     

     

     

      <telerik:AjaxSetting AjaxControlID="RadComboBox1">

     

     

     

        <UpdatedControls>

     

     

     

            <telerik:AjaxUpdatedControl ControlID="RadComboBox1" />

     

     

     

            <telerik:AjaxUpdatedControl ControlID="RadGrid1" LoadingPanelID="RadAjaxLoadingPanel1" />

     

     

     

        </UpdatedControls>

     

     

     

    </telerik:AjaxSetting>

     

     

     

    </AjaxSettings>

     

     

     

    </telerik:RadAjaxManager>



    ***
    <telerik:RadComboBox ID="RadComboBox1" Runat="server"

     

     

     

        DataSourceID="SqlDataSource1" DataTextField="CustBill"

     

     

     

        DataValueField="CustBill" Height="122px" Skin="Windows7" Width="319px">

     

     

     

     

     

     

     

        <Items>

     

     

     

     

     

     

     

            <telerik:RadComboBoxItem Text="All" Value="0" Selected="true" />

     

     

     

     

     

     

     

        </Items>

     

     

     

     

     

     

     

    </telerik:RadComboBox>

     

     

     

     


    *** This SQL Data Source populates the combo box ***

     

    <

     

     

    asp:SqlDataSource ID="SqlDataSource1" runat="server"

     

     

     

        ConnectionString="<%$ ConnectionStrings:crmDashboardConnectionString %>"

     

     

     

        SelectCommand="SELECT TOP (10) CustBill FROM crmSalesSuperior WHERE (CustBill IN (SELECT CustBill FROM crmSalesSuperior AS crmSalesSuperior_1 WHERE (Branch = 102))) GROUP BY CustBill ORDER BY CustBill">

     

     

     

     

    </asp:SqlDataSource>

     

     

     

     



    *** This is the Grid's SQL data source, calling a stored procedure with a parameter from combo box. ***

     

     

     

     

    <asp:SqlDataSource ID="SqlDataSource2" runat="server"

     

     

     

    ConnectionString="<%$ ConnectionStrings:crmDashboardConnectionString %>"

     

     

     

    SelectCommand="CRMDashboardSales" SelectCommandType="StoredProcedure">

     

     

     

     

        <SelectParameters>

     

     

     

     

            <asp:ControlParameter Name="CustBill" ControlID="RadComboBox1"

     

     

     

                PropertyName="SelectedValue" Type="String"

     

     

     

                DefaultValue="Power Equipment Co " />

     

     

     

     

        </SelectParameters>

     

     

     

     

    </asp:SqlDataSource>

     

     

     

     




     

  2. Pavlina
    Admin
    Pavlina avatar
    6187 posts

    Posted 03 Feb 2011 Link to this post

    Hello Scott,

    In order to achieve your goal you should set AutoPostBack property of the RadComboBox control to true:
    ASPX:
    <telerik:RadComboBox ID="RadComboBox1" runat="server" AutoPostBack="True" DataSourceID="SqlDataSource1"
              DataTextField="CustBill" DataValueField="CustBill" Height="122px" Skin="Windows7"
              Width="319px">
              <Items>
                  <telerik:RadComboBoxItem Text="All" Value="0" Selected="true" />
              </Items>
          </telerik:RadComboBox>

    Give this suggestion a try and let me know how it goes.

    All the best,
    Pavlina
    the Telerik team
    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
  3. Scott
    Scott avatar
    5 posts
    Member since:
    Dec 2010

    Posted 03 Feb 2011 Link to this post

    Adding AutoPostBack="true" to combo box solved the problem.  The combo box's selected value is now passed to the stored procedure and the grid gets updated.  Thanks very much for your help and quick response! 
    Scott
Back to Top