Filter datasource/gridvw w/ 2 or more multi-select listboxes

C

chiefsss

(new to asp.net C#, however I've been prg/dev in other langs for yrs)

I have a gridview, tied to a data source.
I have 2 multi-select listboxes that I want to use to filter the datasource.

I am able to build a filter for the datasource FilterExpression from one of
the listboxes and filter the data source without problem since it's values
appear in the end (summarized) result set. The problem occurs when I want to
filter it further based on the other listbox - whose items exist in the
underlying data tables, but do not exist in the fields of the end
(summarized) result set.

Example: The gridview contains results of survey data. I want to filter the
survey data by question number (listbox one - question number appears in the
grid) and then by a demographic (listbox two - does not appear in the grid
since the data is summarized by question number - but demographic field is
part of the underlying data tables - so should be able to filter by it
somehow) The 'group by' for the data source is question number. ---So I can
tell the gridview to show data for only questions 1,2,3 and 7 for example,
but if I only want to see data for demographic groups A, C and G, we have a
problem.

I have tried building and IN string using a hidden field as a parameter such
as
IN('value1','value2'...)

When I try to add to the FilterExpression the selections from the second
listbox, it seems to be ignored because it's grouped by another field which
makes it's value always the same in the end result set.

I don't need or want this demo field in the ending result set, but only to
filter the underlying data by it.

I'm sure I'm missing something easy, but just inexperienced with asp.net.
thank you for your time.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Multi select options in a menu 1
listboxes 0
listboxes......... 3
Border Widths for ListBoxes 1
DataSource 4
Related listboxes and items 0
How to filter DataSource? 3
objectdatasource filter. 3

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top