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

RadAjaxManager not updating controls

2 Answers 203 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Scott
Top achievements
Rank 1
Scott asked on 02 Feb 2011, 05:22 PM
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 Answers, 1 is accepted

Sort by
0
Pavlina
Telerik team
answered on 03 Feb 2011, 10:49 AM
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.
0
Scott
Top achievements
Rank 1
answered on 03 Feb 2011, 03:58 PM
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
Tags
Ajax
Asked by
Scott
Top achievements
Rank 1
Answers by
Pavlina
Telerik team
Scott
Top achievements
Rank 1
Share this question
or