How Can I Set The Initial Search Value of a ComboBox in a Browse Dailog?


Author
Message
lastcanary
lastcanary
StrataFrame User (149 reputation)StrataFrame User (149 reputation)StrataFrame User (149 reputation)StrataFrame User (149 reputation)StrataFrame User (149 reputation)StrataFrame User (149 reputation)StrataFrame User (149 reputation)StrataFrame User (149 reputation)StrataFrame User (149 reputation)
Group: StrataFrame Users
Posts: 81, Visits: 270
I have added a combobox to my search fields in a browse dialog. I am filling the combobox from a database that contains string data. I tried to modify the Initial Search Value of the combobox so that when the browse dialog is loaded it will only display the records with the given Initial Search Value. I am getting error about the "Input string was not in a correct format" when I try to run the application.

Could you please help me to initialize the combobox Search Field on a browse dialog?
Edhy Rijo
E
StrataFrame VIP (4.5K reputation)StrataFrame VIP (4.5K reputation)StrataFrame VIP (4.5K reputation)StrataFrame VIP (4.5K reputation)StrataFrame VIP (4.5K reputation)StrataFrame VIP (4.5K reputation)StrataFrame VIP (4.5K reputation)StrataFrame VIP (4.5K reputation)StrataFrame VIP (4.5K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
Hi,

You have to add the value in the InitializeSearchFields event.  Here is a sample code from one of my browse dialogs where I am setting the TransactionType field value.
Private Sub FirstUseImportBrowseDialog_InitializeSearchFields(ByVal sender As System.ObjectByVal e As System.EventArgsHandles MyBase.InitializeSearchFields
     Me.SearchFields("TransactionType").InitialValue = Enumerations.TransactionType.FirstUseImport
End Sub


Edhy Rijo

lastcanary
lastcanary
StrataFrame User (149 reputation)StrataFrame User (149 reputation)StrataFrame User (149 reputation)StrataFrame User (149 reputation)StrataFrame User (149 reputation)StrataFrame User (149 reputation)StrataFrame User (149 reputation)StrataFrame User (149 reputation)StrataFrame User (149 reputation)
Group: StrataFrame Users
Posts: 81, Visits: 270
Should I have to use enumerations to set the initial value of a combobox in Browse Dialog?

Can I use the value in the Business Object to set the initial value of a combobox?
Edhy Rijo
E
StrataFrame VIP (4.5K reputation)StrataFrame VIP (4.5K reputation)StrataFrame VIP (4.5K reputation)StrataFrame VIP (4.5K reputation)StrataFrame VIP (4.5K reputation)StrataFrame VIP (4.5K reputation)StrataFrame VIP (4.5K reputation)StrataFrame VIP (4.5K reputation)StrataFrame VIP (4.5K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
Hi Lastcanary,

lastcanary (1/20/2012)
Should I have to use enumerations to set the initial value of a combobox in Browse Dialog?

Can I use the value in the Business Object to set the initial value of a combobox?


You can use any value you want.  In my sample I happen to use an enumeration for the "Transaction Type" field value and it is easier for me in code to work with the enumeration for these values.

Edhy Rijo

lastcanary
lastcanary
StrataFrame User (149 reputation)StrataFrame User (149 reputation)StrataFrame User (149 reputation)StrataFrame User (149 reputation)StrataFrame User (149 reputation)StrataFrame User (149 reputation)StrataFrame User (149 reputation)StrataFrame User (149 reputation)StrataFrame User (149 reputation)
Group: StrataFrame Users
Posts: 81, Visits: 270
When I set a combo field to a string value I am getting:

"Input string was not in a correct format"

Lets think that I have a table

1-Person
2-Company
3-Cooperation

When I set initial value to "Person" I am getting
"Input string was not in a correct format" error, how can I handle this?

Edhy Rijo
E
StrataFrame VIP (4.5K reputation)StrataFrame VIP (4.5K reputation)StrataFrame VIP (4.5K reputation)StrataFrame VIP (4.5K reputation)StrataFrame VIP (4.5K reputation)StrataFrame VIP (4.5K reputation)StrataFrame VIP (4.5K reputation)StrataFrame VIP (4.5K reputation)StrataFrame VIP (4.5K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
Hi Lastcanary,

This process should be pretty simple and straight forward. Hehe
You have to set the value based on the value type expected by the key field used in the combobox.  If that does not work, then provide the following info:
  1. What is the type of the value you want to setup up, Sttring, Int, etc?
  2. Paste the whole InitializeSearchFields code so we can see what are you doing.


Edhy Rijo

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search