Problem with Form Dialogs

Stimulsoft Reports.NET discussion
Andre2
Posts: 47
Joined: Thu Jan 24, 2008 12:30 am
Location: Australia

Problem with Form Dialogs

Post 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
Edward
Posts: 2913
Joined: Fri Jun 09, 2006 4:02 am

Problem with Form Dialogs

Post 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.
Andre2
Posts: 47
Joined: Thu Jan 24, 2008 12:30 am
Location: Australia

Problem with Form Dialogs

Post by Andre2 »

Any Progress on this issue?
thanks
Edward
Posts: 2913
Joined: Fri Jun 09, 2006 4:02 am

Problem with Form Dialogs

Post 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.
Attachments
55.ComboboxExample.mrt
(15.37 KiB) Downloaded 256 times
Andre2
Posts: 47
Joined: Thu Jan 24, 2008 12:30 am
Location: Australia

Problem with Form Dialogs

Post by Andre2 »

Thanks for that
Now it works :biggrin:
Edward
Posts: 2913
Joined: Fri Jun 09, 2006 4:02 am

Problem with Form Dialogs

Post 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.
Post Reply