Congratulations to all monthly winners of May 2013 !!! They have won INR 2900 cash and INR 27497 worth prize.
DotNetFunda.Com Logo
Twitter TwitterLinkedIn
YouTubeGoogle
 Online : 7095 |  Welcome, Guest!   Register  Login
 Home > Blogs > C# > Handle the DataError event in datagridview ...
Jvprabhusanthi

Handle the DataError event in datagridview

 Blog author: Jvprabhusanthi | Posted on: 5/3/2012 | Category: C# Blogs | Views: 2276 | Status: [Member] | Points: 75 | Alert Moderator   
Ads

DataGridView Default Error Dialog

---------------------------
The following exception occurred in the DataGridView:


System.ArgumentException: Parameter is not valid.
at System.Drawing.Image.FromStream(Stream stream, Boolean useEmbeddedColorManagement, Boolean validateImageData)
at System.Drawing.ImageConverter.ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, Object value)
at System.Windows.Forms.Formatter.FormatObjectInternal(Object value, Type targetType, TypeConverter sourceConverter, TypeConverter targetConverter, String formatString, IFormatProvider formatInfo, Object formattedNullValue)
at System.Windows.Forms.Formatter.FormatObject(Object value, Type targetType, TypeConverter sourceConverter, TypeConverter targetConverter, String formatString, IFormatProvider formatInfo, Object formattedNullValue, Object dataSourceNullValue)
at System.Windows.Forms.DataGridViewCell.GetFormattedValue(Object value, Int32 rowIndex, DataGridViewCellStyle& cellStyle, TypeConverter valueTypeConverter, TypeConverter formattedValueTypeConverter, DataGridViewDataErrorContexts context)


To replace this default dialog please handle the DataError event.
---------------------------

Solution: I had my data in varbinary and trying to bind to the data grid.. Thats why problem occured. Modified the data into binary. This issue is resolved.

For more references:

http://social.msdn.microsoft.com/Forums/en/Vsexpressvb/thread/8e7dceaa-ce69-48dd-85e4-b6c6f5f03bd9

Cheers,
Venkatesan Prabu .J 
Head, KaaShiv InfoTech.
http://www.kaashivinfotech.com/



Cheers,
Venkatesan Prabu .J
Head, KaaShiv InfoTech
http://kaashivinfotech.com/Ebooks.aspx
Found interesting? Add this to:


Experience:9 year(s)
Home page:http://www.dotnetfunda.com
Member since:Tuesday, May 01, 2012
Level:Starter
Status: [Member]
Biography:
>> Write Response - Respond to this post and get points

More Blogs

About Us | Contact Us | The Team | Advertise | Software Development | Write for us | Testimonials | Privacy Policy | Terms of Use | Link Exchange | Members | Go Top
General Notice: If you find plagiarised (copied) contents on this page, please let us know the original source along with your correct email id (to communicate) for further action.
Copyright © DotNetFunda.Com. All Rights Reserved. Copying or mimicking the site design and layout is prohibited. Logos, company names used here if any are only for reference purposes and they may be respective owner's right or trademarks. | 6/20/2013 12:58:02 AM