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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T22:49:25+00:00 2026-05-16T22:49:25+00:00

I am working on an application in C# using the .NET Framework 3.5. I

  • 0

I am working on an application in C# using the .NET Framework 3.5. I have a TextBox on one of my forms that is bound to the “ID” property of the DataContext of the form, like so:

<TextBox x:Name="txtID" 
    Grid.Row="0" Grid.Column="1" 
    Margin="2" MinWidth="200" VerticalAlignment="Top"
    Style="{StaticResource validationToolTip}"
    >
    <TextBox.Text>
        <Binding Path="ID" UpdateSourceTrigger="PropertyChanged"    
            ValidatesOnDataErrors="true">
            <Binding.ValidationRules>
                <ui:RequiredFieldValidationRule />
            </Binding.ValidationRules>
        </Binding>
    </TextBox.Text>
</TextBox>

I would like the TextBox to display some helper text (“[Leave blank to auto-generate.]”) when the ID property is empty and the TextBox does not have input focus. I am considering styling this text differently (italicize) to distinguish it from a user-typed ID. Since the TextBox.Text property is bound to the ID property, however, I want to make sure that my solution doesn’t cause the ID property to be set to the value of my helper string. How should I go about implementing this behavior?

  • 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-16T22:49:26+00:00Added an answer on May 16, 2026 at 10:49 pm

    The simplest approach would be to have a label over the text box to contain the text, or use a tooltip for the text
    Another approach would be to have a class sit between the control and the data class that you are currently bound to. This class could then pass the required ‘[Leave blank to auto-generate.]’ text if the text in the data class is empty, or pass through the value if it is not. For all the other fields the value would just be a pass through

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

Sidebar

Related Questions

I am working on an ASP.NET web forms application that is using Forms Authentication.
I have been working in a .NET Framework 4 project using server tags like
I have an application working on hand held device with .NET compact framework, using
I'm currently working on web application using VB in ASP.NET. Right now I have
I am working on windows forms applications using c# .net 4.0. Where I have
I have a pretty big web application that I created last year using ASP.NET
I am extending an application using MAF in .net framework. I have implemented a
I am working on a web-based application using asp.net 4.0. I have some dlls
I have an ASP.Net web application using Framework 3.5, an IE9.0 browser, and I'm
I am working on big application build using ASP.NET which was started 1.5 years

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.