Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3301348
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T20:44:33+00:00 2026-05-17T20:44:33+00:00

Here ‘s the documentation. I haven’t found any explanation anywhere. There is a data

  • 0

Here‘s the documentation. I haven’t found any explanation anywhere. There is a data binding overview but is for WPF, and I’m using WinForms. I thought what it does is to call whatever method I assign to the event Format of the Binding class, but it will call it even if I set formattingEnabled to false as long as I assign a method. So now I don’t know what it does, and I don’t understand where is people supposed to get this kind of information.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T20:44:34+00:00Added an answer on May 17, 2026 at 8:44 pm

    It looks like you need a couple pieces… First here’s the Reflector’d bit on the Format event that you’ve added

    protected virtual void OnFormat(ConvertEventArgs cevent)
    {
        if (this.onFormat != null)
        {
            this.onFormat(this, cevent);
        }
        if (((!this.formattingEnabled && !(cevent.Value is DBNull)) && ((cevent.DesiredType != null) && !cevent.DesiredType.IsInstanceOfType(cevent.Value))) && (cevent.Value is IConvertible))
        {
            cevent.Value = Convert.ChangeType(cevent.Value, cevent.DesiredType, CultureInfo.CurrentCulture);
        }
    }
    

    and then there’s this:

    private object FormatObject(object value)
    {
        if (this.ControlAtDesignTime())
        {
            return value;
        }
        Type propertyType = this.propInfo.PropertyType;
        if (this.formattingEnabled)
        {
            ConvertEventArgs args = new ConvertEventArgs(value, propertyType);
            this.OnFormat(args);
            if (args.Value != value)
            {
                return args.Value;
            }
            TypeConverter sourceConverter = null;
            if (this.bindToObject.FieldInfo != null)
            {
                sourceConverter = this.bindToObject.FieldInfo.Converter;
            }
            return Formatter.FormatObject(value, propertyType, sourceConverter, this.propInfoConverter, this.formatString, this.formatInfo, this.nullValue, this.dsNullValue);
        }
        ConvertEventArgs cevent = new ConvertEventArgs(value, propertyType);
        this.OnFormat(cevent);
        object obj2 = cevent.Value;
        if (propertyType == typeof(object))
        {
            return value;
        }
        if ((obj2 != null) && (obj2.GetType().IsSubclassOf(propertyType) || (obj2.GetType() == propertyType)))
        {
            return obj2;
        }
        TypeConverter converter2 = TypeDescriptor.GetConverter((value != null) ? value.GetType() : typeof(object));
        if ((converter2 != null) && converter2.CanConvertTo(propertyType))
        {
            return converter2.ConvertTo(value, propertyType);
        }
        if (value is IConvertible)
        {
            obj2 = Convert.ChangeType(value, propertyType, CultureInfo.CurrentCulture);
            if ((obj2 != null) && (obj2.GetType().IsSubclassOf(propertyType) || (obj2.GetType() == propertyType)))
            {
                return obj2;
            }
        }
        throw new FormatException(SR.GetString("ListBindingFormatFailed"));
    }
    

    So it’s still going to format the object according to what you’ve bound to the Format event handler.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here is my error(if you need any more info just ask)- Error SQL query:
Here the scenario is I have many .aspx pages if any page gives error,
Here is the scenario: I'm writing an app that will watch for any changes
Here is an object that I'd like to use with ng-repeat, but it's not
Here's the code I'm running. Basically I scrape data, and place them into simple
Here is my simplified data structure: Object1.h template <class T> class Object1 { private:
Here's what I'm trying to do... It's quite simple and obviously there must be
Here's what I'm trying to do: When there's a new INSERT into the table
Here's the view: @if (stream.StreamSourceId == 1) { <img class=source src=@Url.Content(~/Public/assets/images/own3dlogo.png) alt= /> }
Here's my code in the <head></head> : <link rel=stylesheet href=http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.css /> <script type=text/javascript src=http://code.jquery.com/jquery-1.7.1.min.js></script>

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.