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

RadGrid filtered by RadCombobox not filtering

1 Answer 43 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Zach
Top achievements
Rank 1
Zach asked on 08 Aug 2014, 02:09 PM
I have a Combobox and grid in a widget.  The grid needs to be filtered as the selection in the combobox changes.  Currently when the selection changes, the grid reloads, but always displays the same data.  Any ideas how to fix this?  Or even debug it?

<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
 
<telerik:RadScriptManager runat="server" ID="RadScriptManager1" />
<telerik:RadFormDecorator ID="QsfFromDecorator" runat="server" DecoratedControls="All" EnableRoundedCorners="false" />
 
<label for="NamesDDL">Select plant name to view its reports:</label>
<div style="margin-top: 15px;">
    <telerik:RadComboBox ID="NamesDDL" runat="server" AutoPostBack="True" DataSourceID="dllDataSource"
        DataTextField="PlantNameAndID" DataValueField="PlantID" Width="250px" Height="150px"
        AppendDataBoundItems="true" >
        <Items>
            <telerik:RadComboBoxItem Text="All" Value="0" Selected="true"></telerik:RadComboBoxItem>
        </Items>
    </telerik:RadComboBox>
</div>
 
<div style="margin: 15px 0 20px;">
    <telerik:RadGrid ID="OrdersGrid" AllowPaging="true" DataSourceID="gridSource" runat="server"
        GridLines="None" AllowSorting="true" HeaderStyle-ForeColor="Black" HeaderStyle-HorizontalAlign="Center">
    </telerik:RadGrid>
</div>
 
<asp:SqlDataSource ID="dllDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:Dev-TestOilConnectionString %>"
    SelectCommand="select customer.plant.PlantID, customer.plant.PlantNo, customer.plant.PlantName, customer.plant.PlantID, cast(customer.plant.PlantID as varchar) + ' - ' + customer.plant.PlantName as PlantNameAndID from customer.plant where plant.CustID = 10 order by plant.PlantNo"></asp:SqlDataSource>
 
<asp:SqlDataSource ID="gridSource" runat="server" ConnectionString="<%$ ConnectionStrings:Dev-TestOilConnectionString %>"
    SelectCommand="select LabID, SampleDate, MachCond, LubCond, CustReview, CustReviewDte, machine.PlantID from customer.plant inner join customer.machine on machine.PlantID = plant.PlantID inner join sample.sample on sample.PointID = machine.PointID where ((machine.PlantID = @PlantID and @PlantID <> 0) or (machine.PlantID = machine.PlantID and @PlantID = 0)) and plant.custid = 10">
    <SelectParameters>
        <asp:ControlParameter Name="PlantID" PropertyName="SelectedValue" ControlID="NamesDDL"></asp:ControlParameter>
    </SelectParameters>
</asp:SqlDataSource>
 
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" EnableAJAX="true" DefaultLoadingPanelID="RadAjaxLoadingPanel1">
    <AjaxSettings>
        <telerik:AjaxSetting AjaxControlID="NamesDDL">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="OrdersGrid" LoadingPanelID="AjaxLoadingPanel1"></telerik:AjaxUpdatedControl>
                <telerik:AjaxUpdatedControl ControlID="NamesDDL"></telerik:AjaxUpdatedControl>
            </UpdatedControls>
        </telerik:AjaxSetting>
    </AjaxSettings>
</telerik:RadAjaxManager>
 
<telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server">
</telerik:RadAjaxLoadingPanel>

1 Answer, 1 is accepted

Sort by
0
Pavlina
Telerik team
answered on 11 Aug 2014, 11:57 AM
Hi Zach,

The provided code looks correct. Could you confirm that the same issue persists when the combo and the grid are not in a widget?

Regards,
Pavlina
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
Grid
Asked by
Zach
Top achievements
Rank 1
Answers by
Pavlina
Telerik team
Share this question
or