DataGridView automatically adding bindingsource columns in VS 2005 Designer

Hello,

I'm experiencing an annoying problem with DataGridViews which are bound to class objects. All fields from my class objects are added to the columns collection of DataGridViews, when the forms or custom controls that contain them are viewed within the VS 2005 designer. I haven't been able to figure out how to stop the designer from auto-adding all of the fields found within the bindingsource object.

Any help would be greatly appreciated.

Chris Durkin



Answer this question

DataGridView automatically adding bindingsource columns in VS 2005 Designer

  • hehongyu2000

    Hi C.Patrick,

    Thanks a lot for your feedback. Congratulations! Would you please mark the post as answered if it has been useful to you.

    Regards,

    Cleo



  • dotnetscot

    I'm having the same problem. The "answer" that I will manually have to add columns to all my datagrids seems unacceptable.

    Will this be fixed soon This defeats the purpose of having a designer to speed application development time.

    Bryan


  • Mounir27

    Hi Chris,

    It's the mechanism of form designer runtime. You can extract the code of DataGridView bounding from the InitializeComponent() method of its container, then the designer runtime will not automatically be viewed.

    I sincerely hope it helps. We very much value your comments and look forward to further feedback from you. Please feel free to ask if you have any questions.

    Best regards,

    Cleo



  • Juan Pane

    I have exactly the same issue.

    the funny aspect is that in my application I have MORE DataGridView's and only one has such a strange behaviour.

    after a check the code seems to be identical in all of them.

    any idea


  • naguaramipana

    Cleo,

    Thanks for the help. This seems to have fixed my problem. Now, I just manually data bind the DataGridView within the container's load event. Sorry that it took so long to respond. I was fighting other fires.

    C. Patrick


  • DataGridView automatically adding bindingsource columns in VS 2005 Designer