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
>