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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T21:32:19+00:00 2026-05-31T21:32:19+00:00

In my current windows application I am looking on how to give a datasource

  • 0

In my current windows application I am looking on how to give a datasource to my usercontrol.
On my page I add my own usercontrol in a flowlayoutpanel, the usercontrol has 3 textboxes in it which I want to fill with data from a datasource.

 usercontrol uc = new usercontrol();
 flowlayoutpanel.Controls.Add(uc);
 uc.DataSource?

I know that in silverlight and ASP.NET you can add a datasource to a usercontrol. In the usercontrol you get the data into the textboxes by using {Binding fieldname} as their content. I can’t find any information on this for Windows Forms.

Thanks for the help.
Thomas

  • 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-31T21:32:20+00:00Added an answer on May 31, 2026 at 9:32 pm

    I solved this (thanks to the link of Stuart) by putting setters and getters in my usercontrol.

    public partial class ucOpleiding : UserControl
    {
       public string Datum
       {
            get { return txtDatum.Text; }
            set { txtDatum.Text = value; }
       }
    
       public string Plaats
       {
           get { return txtPlaats.Text; }
           set { txtPlaats.Text = value; }
       }
    
       public string Omschrijving
       {
           get { return txtOmschrijving.Text; }
           set { txtOmschrijving.Text = value; }
       }
    
        public ucOpleiding()
        {
            InitializeComponent();
        }
    

    And in my main form I will then call those setters and getters.

    foreach (opleiding opl in ChauffeurManagement.getOpleidingen(Int32.Parse(cbbID.SelectedValue.ToString())))
    {
         ucOpleiding uc = new ucOpleiding();
    
         uc.Datum = opl.datum.ToString();
         uc.Plaats = opl.plaats_instantie;
         uc.Omschrijving = opl.omschrijving;
    
         flpOpleidingen.Controls.Add(uc);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a current system which is build as a Windows Application, and does
I'm in a ASP.NET application using Windows Authentication. I'm using HttpContext.Current.User.Identity.Name to get the
Current Application Server Configuration: IIS 6.0 Windows 2003 Server Standard Edition SP2 .NET Framework
Want to send the text from my current vb application to the Active Window
I'm currently using Unity with Unity.Mvc3 in my MVC3 application which uses Windows Authentication.
Our application has a lot of .NET assemblies, which up until now, has not
Under the current Windows Phone 7 Application Certification Requirements (pdf) applications running under lock
I am looking for a map application with the following: Windows based. City/Town street
Is there a way to find the application name of the current active window
I'm using Delphi and need to get the current Windows DNS server IP address

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.