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

Use Checkboxlist to generate multiple select parameters

1 Answer 109 Views
Grid
This is a migrated thread and some comments may be shown as answers.
chris
Top achievements
Rank 2
chris asked on 15 Jun 2009, 02:03 PM
Hi guys,

I am using a combination of RadSplitters with sliding panes and static panes to display monthly sales data.

The static panes section has 3 radgrids showing Period data, Year-To-Date data and lastly Year-On-Year data
The sliding panes section has to panes the first being a general information and help area telling the user what to do and the second has two comboboxes (both integers) and a checkboxlist (string) - all of which determine the select parameters for the sql datasource.

After making selections each radgrid visibility is set to true and then databound

I have no problem in getting the selected value for each and applying to the datasource, howevere mut problem arises when making multple selections in the checkbox list. For example the user may wish to combine sales departments and view the net result. The second selection only populates the grid when the first is unchecked. How can I stop this to return all or some departments?

SqlDataSource as follows :-

 

<asp:SqlDataSource ID="YellowBookPeriodSummaryData" runat="server" ConnectionString="<%$ ConnectionStrings:Intranet_DBConnectionString %>"

 

 

SelectCommand="SELECT TOP 100 PERCENT Year, Period, SUM(Qty) AS Quantity, SUM(Volume) AS [Vol Sq Ft], SUM(NetSales) AS [Net Value], SUM(StdCost) * - 1 AS Cost, SUM(Margin) AS [Margin ()], (SUM(NetSales) + SUM(StdCost)) / SUM(NetSales) * 100 AS [Margin (%)] FROM Tbl_Sales_Downloads WHERE (SalesCategory IN (@Category)) GROUP BY Year, Period HAVING (Year = @Year) AND (Period = @Period)">

 

 

<SelectParameters>

 

 

<asp:ControlParameter ControlID="CheckBoxList1" Name="Category" PropertyName="SelectedValue"

 

 

Type="String" />

 

 

<asp:ControlParameter ControlID="CbxYear" Name="Year" PropertyName="SelectedValue"

 

 

Type="Int64" />

 

 

<asp:ControlParameter ControlID="CbxPeriod" Name="Period" PropertyName="SelectedValue"

 

 

Type="Int64" />

 

 

</SelectParameters>

 

 

</asp:SqlDataSource>

 


Any Ideas welcomed
thanks in advance
Chris

1 Answer, 1 is accepted

Sort by
0
Yavor
Telerik team
answered on 16 Jun 2009, 05:51 AM
Hi chris,

The question set forth has been addressed in the support ticket, which you have opened on the matter. To avoid duplicate posts, we can continue our communication there.

All the best,
Yavor
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
Grid
Asked by
chris
Top achievements
Rank 2
Answers by
Yavor
Telerik team
Share this question
or