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

  • Home
  • SEARCH
  • 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 119777
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T03:42:24+00:00 2026-05-11T03:42:24+00:00

Originaly posted a while back on a different forum, hope I can find a

  • 0

Originaly posted a while back on a different forum, hope I can find a bit more help here 🙂

Hi Guys,

I’m sure this is a pretty basic question, but I’m new to much programming and C#. I find I need to clear databindings on several controls and currently have:

            lblTableValue1.DataBindings.Clear();             lblTableValue2.DataBindings.Clear();             lblTableValue3.DataBindings.Clear();             lblTableValue4.DataBindings.Clear();             lblTableValue5.DataBindings.Clear();             lblTableValue6.DataBindings.Clear();             lblTableValue7.DataBindings.Clear(); 

This can’t be the best way of doing this can it? I also need to set all these text values to ”, can I group them in someway and call clear on the whole group?

Many Thanks in advance G

  • 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. 2026-05-11T03:42:24+00:00Added an answer on May 11, 2026 at 3:42 am
    foreach(Control c in this.Controls) {     if(c.Name.StartsWith('lblTableValue'))     {         c.DataBindings.Clear();     } } 

    That might do the job. Or if you’re more of a purist:

    foreach(Control c in new Control[]     {         lblTableValue1,         lblTableValue2,         etc     }) {     c.DataBindings.Clear(); } 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

You can see my posted code here . My original problem was more or
Originally, I posted this on ServerFault ... but perhaps it is more of a
Possible Duplicate: Can someone Explain this jQuery code? I have posted this before, but
Actually this is a more specific version of a question I posted in past
SO, I have been working on this for a while, I posted a much
I'd like to expand a question I posted a while ago : I'm querying
i've been working with this for a while and i can't seem to figure
Thank you all for your help. A number of you posted (as I should
This is a question that extends from the originally posted here: Link to loading-xaml
I've successfully posted a single array, but I can't figure out how to send

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.