StrataFrame Forum

Browse Dialog

http://forum.strataframe.net/Topic12559.aspx

By Paul Chase - 11/8/2007

I have a browse dialog that is using a business object to populate a combo for a search field, the combo is populating fine however after making a selection I get the following error

the combo box's value member is a string and the field to be searched is a string ,

It looks like it failing on

llReturn = CType(.SelectedValue, Integer) <> -1

 

P

By StrataFrame Team - 11/8/2007

Hrm... not sure why that's there... there's no reason for it to force the value to be an integer.  I'll look into it.
By StrataFrame Team - 11/8/2007

Yeah, not only is the .SelectedValue not always a System.Int32, but why would -1 not be a valid value? 

Oh well, I've changed that line to this:

llReturn = .SelectedValue IsNot Nothing

Since you're building the source code, I'll let you change it on your end, too.  But if you want me to post the DLLs for it, just let me know Smile

By Paul Chase - 11/8/2007

Thanks Ben, I made tha change here as well.

Paul

By StrataFrame Team - 11/8/2007

Let me know how it works, btw.  What I've tested here works, but make sure it works for your search field, too.
By Paul Chase - 11/8/2007

Yeah I was just about to say "Houston we have a problem". 
By Paul Chase - 11/8/2007

Ben,

It looks like the -1 was used as a value for "Not Used" in the combo which is added when the combo is created, thus the test was to exclude Not Used from the search.

I changed the code to look at selected index which seems to work ok. i'll let you know if it doesnt.

llReturn = .SelectedIndex > 0

 Paul

By StrataFrame Team - 11/13/2007

Yep, we went back and revisited that and that is exactly what we did, too.
By StrataFrame Team - 11/13/2007

We also made some changes so that you can have non integer values as the values of the combo box for GUIDs and strings and such.  Trent should be posting an update soon with the changes.