Page 2 of 2

Problem with Form Dialogs

Posted: Wed Apr 16, 2008 4:34 pm
by Andre2
Nope Still does NOT work
The selected item is NOT being read correctly
If the the combo box is filled from a database of names (this Works)

FullName,Code

in databindings:
Items is set to Fullname
SelectedItem is set to Code

using the supplied example

MyVariable = ComboBox.SelectedItem.ToString()

Results in MyVariable = FullName NOT Code as required

Problem with Form Dialogs

Posted: Thu Apr 17, 2008 12:23 am
by Edward
Andre wrote:Nope Still does NOT work
The selected item is NOT being read correctly
If the the combo box is filled from a database of names (this Works)
FullName,Code
Yes, the ComboBox is working now only for one field from the DataSource. If you need to select some additional field from the DataSource, e.g. Code, then some additional programming must be done.

in databindings:
Items is set to Fullname
SelectedItem is set to Code

using the supplied example

MyVariable = ComboBox.SelectedItem.ToString()

Results in MyVariable = FullName NOT Code as required
We'll post the result of our investigations about this a bit later.

Thank you.

Problem with Form Dialogs

Posted: Wed Apr 23, 2008 2:10 am
by Andre2
Any Progress on this issue?
thanks

Problem with Form Dialogs

Posted: Wed Apr 23, 2008 3:39 am
by Edward
You can use one trick if you want to retrieve a column from the DataSource using SelectedIndex property of the Combobox:

Code: Select all

string AnotherValueFromThisRow = comboBox.SelectedIndex ==-1?"":MyDataSource.GetData("ColumnName", comboBox.SelectedIndex).ToString();
Please download sample report for the Demo.exe application again.

Thank you.

Problem with Form Dialogs

Posted: Wed Apr 23, 2008 3:34 pm
by Andre2
Thanks for that
Now it works :biggrin:

Problem with Form Dialogs

Posted: Thu Apr 24, 2008 3:45 am
by Edward
It really was a trick but it worked and you can use it for retrieving as much fields from the 'selected' datasource row as you need it.

Thank you.