Combobox runtime binding

Stimulsoft Reports.NET discussion
Post Reply
a.marinelli
Posts: 17
Joined: Wed Nov 14, 2012 1:39 pm

Combobox runtime binding

Post by a.marinelli »

I'm trying to bind a combobox to a datasource at runtime in a dialog form.

1) I prepared the datasource (with a @needle param)
2) I added to a new dialog form a textbox, a combo and a button
3) I set the datasource to NOT connect on start and I binded it to combo
4) I start writing in the text, then press the button (to start the search)
5) on click method I get the text from textbox, set the parameter value and connect the datasource

the combobox is NOT getting the filtered value from its binding... how to force/refresh the binding?
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: Combobox runtime binding

Post by Alex K. »

Hello,

Please send us your report with test data for analysis.

Thank you.
a.marinelli
Posts: 17
Joined: Wed Nov 14, 2012 1:39 pm

Re: Combobox runtime binding

Post by a.marinelli »

It's really simple, you can bind it to any test table with ID/Name...
Attachments
TestReport.zip
(2.1 KiB) Downloaded 146 times
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: Combobox runtime binding

Post by Alex K. »

Hello,

Please try to add each item in combobox:

Code: Select all

Products.Parameters["@p1"].ParameterValue = TextBoxControl1.Text;

Products.Connect(); ;
this.ComboBoxControl1.Control.Items.Clear();

foreach (DataRow row in Products.DataTable.Rows)
{
    this.ComboBoxControl1.Control.Items.Add(row["ProductName"]);
}
a.marinelli
Posts: 17
Joined: Wed Nov 14, 2012 1:39 pm

Re: Combobox runtime binding

Post by a.marinelli »

ok, I will remove the bindings and try with this approach...

thanks
Andrew
Posts: 4109
Joined: Fri Jun 09, 2006 3:58 am

Re: Combobox runtime binding

Post by Andrew »

Hello,

This would be great if you send us information about the result.

Thank you.
Post Reply