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 610507
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T17:40:59+00:00 2026-05-13T17:40:59+00:00

I have a list of classes that represent mydatabase tables for example Address,Client. My

  • 0

I have a list of classes that represent mydatabase tables for example Address,Client.

My GUI tends to be a grid of data and an data entry form. This works fine for single table data entry however I now have a form that has client information and their address.

I was thinking of using a ViewModel combining the Address and Client class and assigning that to a bindingsource and binding my controls to that.

How would I bind the controls to the property names? Would this work…

if (txtLine1.DataBindings.Count == 0)
                txtLine1.DataBindings.Add("Text", bindingSource, "Address.Line1", false, DataSourceUpdateMode.OnPropertyChanged);

Is having a ViewModel even possible for Winforms databinding?

  • 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-13T17:40:59+00:00Added an answer on May 13, 2026 at 5:40 pm

    I created a ViewModel and then created a DataSource in VS. I then dragged the properties of the classes in my viewmodel to the form and this created the controls I needed. I then call the Save method for each class in my viewmodel.

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

Sidebar

Related Questions

I've got a bunch of classes that describe database schema: Table,Field,ForeignKey. Tables have ForeignKeys
Is it possible to use Except() for two List's that have two different classes
I would like to get a list of classes that are available at runtime
I have 3 different classes, a generic entity class, and then two classes that
I have a postgresql database that has this column structure: Author id name Book
I need some help with defining a dynamic method. Basically, I have many classes
First off, I'm not asking for anyone to do my homework. I'm simply confused
I am working on a lightweight document management system and am looking for some
I was recently profiling an application trying to work out why certain operations were
EDIT: It looks like their is no simpler way to do this. Given the

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.