Custom Format/Parse


Author
Message
James H Hansen
James H Hansen
StrataFrame Beginner (29 reputation)StrataFrame Beginner (29 reputation)StrataFrame Beginner (29 reputation)StrataFrame Beginner (29 reputation)StrataFrame Beginner (29 reputation)StrataFrame Beginner (29 reputation)StrataFrame Beginner (29 reputation)StrataFrame Beginner (29 reputation)StrataFrame Beginner (29 reputation)
Group: Forum Members
Posts: 11, Visits: 57
I am trying to complete a test of StrataFrame before my trial runs out on Thursday.  One of the tasks is to create a data entry form where one of the controls displays an enters values from a column that is in centi-seconds in a format like "1:30:22.55".   I've done this before by using the Format and Parse events of the control's binding, but I can't figure out how to do that with StrataFrame.

I also tried adding a custom column in the BO that returns a TimeSpan, but in addition to not formatting the value the way I want to (showing exactly hundredths of a second), I it doesn't post the changed value back to the table via the BO property's set.

Any suggestions?

...Jim

Replies
James H Hansen
James H Hansen
StrataFrame Beginner (29 reputation)StrataFrame Beginner (29 reputation)StrataFrame Beginner (29 reputation)StrataFrame Beginner (29 reputation)StrataFrame Beginner (29 reputation)StrataFrame Beginner (29 reputation)StrataFrame Beginner (29 reputation)StrataFrame Beginner (29 reputation)StrataFrame Beginner (29 reputation)
Group: Forum Members
Posts: 11, Visits: 57
Thanks for trying to help, Trent.  Your assurance kept me looking and I figured it out with the help of some previous postings on newsgroups.  Hang on to your hat:

First, my custom class for centi-seconds that already did the parsing and formatting worked great, but to use it as the type of the BO property for the custom column I first had to create a custom TypeConverter to go with it (easy!).  But that still didn't get it working.

The second piece to the puzzle was the same reason that the TimeSpan didn't work: I have to have formattingEnabled set to true in the binding object.  Ergo, I had to set BindingFormat to something on the control so StrataFrame would set formattingEnabled to true.  That done, my set on the BO property gets called just fine!  Why the binding object needs to have formattingEnabled set to true for TimeSpan and my custom type, but not for double is beyond meCrazy!

Trent Taylor
Trent Taylor
StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 7K
I'm glad that you got it going Smile 
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