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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T11:14:59+00:00 2026-05-30T11:14:59+00:00

I was using the following XAML: <Label Grid.Row=0 Grid.Column=0 Content=Datum/> <Label Grid.Row=0 Grid.Column=1 Content={Binding

  • 0

I was using the following XAML:

<Label Grid.Row="0" Grid.Column="0" Content="Datum"/>
<Label Grid.Row="0" Grid.Column="1" Content="{Binding TimeStamp, StringFormat={}{0:yyyy-MM-dd HH:mm:ss.fff}}"/>
<Label Grid.Row="0" Grid.Column="2" Content="Level"/>
<Label Grid.Row="0" Grid.Column="3" Content="{Binding Level}"/>

but the TimeStamp was being formatted like this:

2.24.2012 7:38

I started up Snoop (great tool!) and noticed that the Label is actually composed of a TextBox and that this TextBox contained the TimeStamp formatted as I defined it. I then replaced the Label with a TextBox and I get the TimeStamp correctly formatted.

<TextBlock Grid.Row="0" Grid.Column="1" Text="{Binding TimeStamp, StringFormat={}{0:yyyy-MM-dd HH:mm:ss.fff}}"/>

2012-02-24 07:38:23.123

I have defined no Resource, Trigger or Style blocks to override Label behaviour so I’m wondering why this is happening.

Any ideas?

  • 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-30T11:15:01+00:00Added an answer on May 30, 2026 at 11:15 am

    The Binding.StringFormat property doesn’t work on Labels, you need to use the ContentStringFormat property on the Label

    <Label Grid.Row="0" Grid.Column="1" Content="{Binding TimeStamp}">
        <Label.ContentStringFormat>0:yyyy-MM-dd HH:mm:ss.fff</Label.ContentStringFormat>
    </Label>
    

    also see Binding only part of a label

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

Sidebar

Related Questions

I'm using the following xaml to fill the dataContext: DataContext={Binding RelativeSource={RelativeSource TemplatedParent}} The application
I have the following XAML: <Grid x:Name=LayoutRoot Background=White DataContext={Binding Source={StaticResource MyDataKey}}> <TextBox Name=_myId Text={Binding
I am binding a listbox with contacts address using following xaml code <ListBox Name=ContactResultsDataLINQ
I have created two buttons using the following XAML code. <Button x:Name=Button1 Width=100 Content=Button1
I have the following XAML: <ListBox SelectedItem={Binding SelectedTeam}> <ListBoxItem Content={Binding Match.HomeTeam} /> <ListBoxItem Content={Binding
I'm trying to display a string in XAML using Label control. Following is my
I have the following XAML: <UserControl.Resources> <local:MainPageViewModel x:Key=ViewModel /> </UserControl.Resources> <Grid x:Name=LayoutRoot DataContext={Binding Source={StaticResource
I am using following class to show a grid like appearance with pagination on
I'd like to write out the following XAML using LINQ to XML via C#.
I was using the following xaml in wpf: <Style TargetType={x:Type Border}> <Setter Property=BitmapEffect> <Setter.Value>

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.