Home Forums WPF controls Xceed DataGrid for WPF Binding to DateTimeTextBox

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #26509 |

    I am trying to use the datetime textbox in a form that displays a person date of birth the value comes from an sql server 2005 database datetime field.

    When I insert my textbox as follows, where the datacontext of the form is set to the current person being viewed….

    <DateTimeTextBox
    x:Name=”uxDatePicker_Dob”
    Grid.Row=”2″
    Grid.Column=”1″
    Width=”125″
    HorizontalAlignment=”Left”
    DateTimeMaskMode=”ShortDate”
    Text=”{Binding Path=DOB}”
    />

    The textbox does not display the date of birth, am I missing something?

    Thanks,
    Scott

    Imported from legacy forums. Posted by Scott (had 3430 views)

    User (Old forums)
    Member
    Post count: 23064

    i have a similar problem. i want to bind the Text of the DateTimeTextBox to a DatePicker’s SelectedDate:

    <xcdg:DateTimeTextBox Text=”{Binding Path=SelectedDate, ElementName=UiDatePicker}” DateTimeMaskMode=”ShortDate” />
    <xcdg:DatePicker x:Name=”UiDatePicker” DateTimeMaskMode=”ShortDate” />

    but it does not work?
    i am using the controls outside a DataGrid.

    any hints?

    thx, k.

    Imported from legacy forums. Posted by noname (had 528 views)

    User (Old forums)
    Member
    Post count: 23064

    okay i got it, i need to bind to Value instead of Text in the DateTimeTextBox.

    Imported from legacy forums. Posted by noname (had 447 views)

    User (Old forums)
    Member
    Post count: 23064

    I tried binding to value as well, still shows up blank. The only way I have even gotten close is to create a converter that strips everything but the number out of the date, so 01/01/2008 becomes 01012008. However, that doesn’t seem to hold it’s value then.

    Imported from legacy forums. Posted by Scott (had 656 views)

    User (Old forums)
    Member
    Post count: 23064

    Nevermind, binding to value worked. The dates must have gotten removed from my test data somehow when I was playing with the DateTimeTextBox yesterday.

    Thanks for the help!

    Imported from legacy forums. Posted by Scott (had 4494 views)

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.