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

Create a parameter combo box for report viewer?

1 Answer 224 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
ryan
Top achievements
Rank 1
ryan asked on 04 Jul 2010, 08:28 PM
Hello,

I want to create a report viewer parameter combo box but can't seem to figure out a certain part of doing it.  When I'm creating the report parameter, how do I choose the values for the combo box?  I.e. I need a combo box where the user can choose between two values which are "Summary" and "Detailed".  I tried putting those values into an array and assigning it to the AvailableValues.DataSource but that didn't work because it then asks me to fill DisplayMember and ValueMember (which is a problem because an Array doesn't have column names, which is what DisplayMember and ValueMember want).  I also can't find a single example of how to do this.  Anyone know how to do this?

Ryan

1 Answer, 1 is accepted

Sort by
0
Steve
Telerik team
answered on 05 Jul 2010, 09:50 AM
Hello ryan,

If you're using an array, clearly the ValueMember and DisplayMember would match, so the correct syntax is:

string[] myarray = new string[2] { "Summary", "Detailed" };
this.ReportParameters[0].AvailableValues.DataSource = myarray;
this.ReportParameters[0].AvailableValues.ValueMember = "=Fields.Item";

Greetings,
Steve
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
General Discussions
Asked by
ryan
Top achievements
Rank 1
Answers by
Steve
Telerik team
Share this question
or