Subclassing a SF ComboBox


Author
Message
Ger Cannoll
Ger Cannoll
Advanced StrataFrame User (866 reputation)Advanced StrataFrame User (866 reputation)Advanced StrataFrame User (866 reputation)Advanced StrataFrame User (866 reputation)Advanced StrataFrame User (866 reputation)Advanced StrataFrame User (866 reputation)Advanced StrataFrame User (866 reputation)Advanced StrataFrame User (866 reputation)Advanced StrataFrame User (866 reputation)
Group: StrataFrame Users
Posts: 430, Visits: 507
I have subclassed a SF combo box as:

public class ComboBox : MicroFour.StrataFrame.UI.Windows.Forms.ComboBox
{
}

However, when I use this, I get an error. Do I need to run the base code for ListPopulatingEvent (as I use this) or any other code in my subclassed control ?


Reply
Ger Cannoll
Ger Cannoll
Advanced StrataFrame User (866 reputation)Advanced StrataFrame User (866 reputation)Advanced StrataFrame User (866 reputation)Advanced StrataFrame User (866 reputation)Advanced StrataFrame User (866 reputation)Advanced StrataFrame User (866 reputation)Advanced StrataFrame User (866 reputation)Advanced StrataFrame User (866 reputation)Advanced StrataFrame User (866 reputation)
Group: StrataFrame Users
Posts: 430, Visits: 507
Hi Les. Many thanks for spending the time on this. I was having a problem with the Combobox on my own data , so that is why I decided to use the SF sample data and of course had to pick the one field that is not populated...it was showing the same results as my own data , so I did not check further..turns out it was showing similar results but for a different reason.

I have now investigated further and can reproduce the results with the SF sample ..but with a field that has data. The following sequence causes an error

1. Set up the Customer Businessss Object, and set all String fields to Trim Right in the BO mapper
2. Set up the products  Business Object as normal (i.e. dont Right Trim any of the fields)
3. Change the field that is the source of the drop dwon (in my example I now used the prod_name field...which has data in it)
4. Pick say the first 4 records of this table and add a few blank spaces to the end of the the prod_name
5. Rebuild the project and test
6. If you select an item from the drop down , and select one of the records that you have added a few blanks, two things happen that I would not have expected
a) The drop down field itself becomes blank
b) When you leave the drop down field, an error is thrown
  Invalid Cast Exception was unhandled by code
...unable to cast object of type 'ssytem.dbnull' to type system.string

The reason this was happening with my own data was because I had imported a table , the drop down field was 10 character string field and say it has 'ABCD' the import padded this out with 6 blanks

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Threaded View
Threaded View
Ger Cannoll - 16 Years Ago
Bill Cunnien - 16 Years Ago
Greg McGuffey - 16 Years Ago
Les Pinter - 16 Years Ago
Ger Cannoll - 16 Years Ago
                 What is the error?
Trent L. Taylor - 16 Years Ago
Ger Cannoll - 16 Years Ago
                         Hi Gerard, A guy's walking down the street and sees a drunk down on...
Les Pinter - 16 Years Ago
                             Hi Les,

Very funny! at least after the 2 hours has passed...
Edhy Rijo - 16 Years Ago
                             Hi Les. Many thanks for spending the time on this. I was having a...
Ger Cannoll - 16 Years Ago

Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search