StrataFrame Forum
Back
Login
Login
Home
»
StrataFrame Application Framework - V1
»
Business Objects and Data Access (How do I?)
»
Error using Custom Field Property for PictureBox
Error using Custom Field Property for PictureBox
Post Reply
Like
1
Error using Custom Field Property for PictureBox
View
Flat Ascending
Flat Descending
Threaded
Options
Subscribe to topic
Print This Topic
RSS Feed
Goto Topics Forum
Author
Message
Chris Diesel
Chris Diesel
posted 7 Years Ago
ANSWER
Topic Details
Share Topic
Group: StrataFrame Users
Posts: 74,
Visits: 300
I get this error I believe during binding of a Custom Field Property to your PictureBox control. If I break execution right before the field value is returned, it looks correct.
Error:
An error occurred while refreshing the data from field 'IwbProduct.PrimaryImage' to property 'Image' on control '.'
Inner Exception:
Cannot format the value to the desired type.
#region Custom Field Properties
[Description("Primary Image"), Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public byte[] PrimaryImage
{
get
{
byte[] primaryImage = new byte[0];
if (this.Count > 0 && this.CurrentRow != null)
{
using (IwbProductImages iwbProductImages = new IwbProductImages())
{
primaryImage = iwbProductImages.GetPrimaryImage(this.Guid);
}
}
return primaryImage;
}
}
#endregion
/// <summary>
/// Provider property descriptors for the custom bindable fields
/// </summary>
protected override MicroFour.StrataFrame.Business.FieldPropertyDescriptor[] GetCustomBindablePropertyDescriptors()
{
//-- Return the array of property descriptors
return new MicroFour.StrataFrame.Business.FieldPropertyDescriptor[] { new ReflectionPropertyDescriptor("PrimaryImage", typeof(IwbProduct)) };
}
Thanks,
Chris
Tags
CFP PictureBox Binding
Reply
Like
1
GO
Merge Selected
Merge into selected topic...
Merge into merge target...
Merge into a specific topic ID...
Open Merge
Threaded View
Threaded View
Error using Custom Field Property for PictureBox
Chris Diesel
-
7 Years Ago
The Image property on the PictureBox is a System.Drawing.Bitmap, not a...
StrataFrame Team
-
7 Years Ago
Thank you so much!!!! :)
Chris Diesel
-
7 Years Ago
That worked great when there is an image to display. Having problems...
Chris Diesel
-
7 Years Ago
Any time the property get throws an error during binding, it wraps it...
StrataFrame Team
-
7 Years Ago
Post Reply
Like
1
Similar Topics
Post Quoted Reply
Reading This Topic
Login
Login
Remember Me
Reset Password
Resend Validation Email
Login
Explore
Messages
Mentions
Search