Page 1 of 1

Combobox runtime binding

Posted: Mon Feb 10, 2014 3:58 pm
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?

Re: Combobox runtime binding

Posted: Tue Feb 11, 2014 6:22 am
by Alex K.
Hello,

Please send us your report with test data for analysis.

Thank you.

Re: Combobox runtime binding

Posted: Tue Feb 11, 2014 9:44 am
by a.marinelli
It's really simple, you can bind it to any test table with ID/Name...

Re: Combobox runtime binding

Posted: Wed Feb 12, 2014 11:36 am
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"]);
}

Re: Combobox runtime binding

Posted: Wed Feb 12, 2014 5:02 pm
by a.marinelli
ok, I will remove the bindings and try with this approach...

thanks

Re: Combobox runtime binding

Posted: Thu Feb 13, 2014 4:01 am
by Andrew
Hello,

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

Thank you.