Welcome to the Xceed Community Sign in | Join | Help
Community Search  

DataBinding in DatePicker outside grid

Sort Posts: Previous Next
  •  05-13-2008, 4:40 AM Post no. 12197

    DataBinding in DatePicker outside grid

    Hi,
    I'm trying to use a DatePicker outside of the DataGrid control, but I'm having trouble updating the datasource (System.Data.DataSet) with the SelectedDate value.
    The correct SelectedDate value is displayed in the DatePicker control when the Window is opened, but it seems as the Binding object for the DatePicker control is deleted upon selecting a date.

    In advance, thanks!
  •  05-13-2008, 8:40 AM Post no. 12210 in reply to 12197

    Re: DataBinding in DatePicker outside grid

    There should be no issues using the DatePicker outside the grid. Do you have any binding errors in the output window? Would it be possible for you to post the code you are using?
    Technical Writer - Xceed Software

    Of all the things I've lost, I miss my mind the most. - Mark Twain
  •  05-13-2008, 9:31 AM Post no. 12214 in reply to 12210

    Re: DataBinding in DatePicker outside grid

    Hi Jenny,
    Thanks for your reply.
    After debugging the Binding, I found that setting Mode=TwoWay in the Binding markup extension solved the problem.

  •  05-14-2008, 11:48 AM Post no. 12260 in reply to 12214

    Re: DataBinding in DatePicker outside grid

    Could you post an example of DatePicker databinding, then ? I would like to see how you solved it. Thanks!
  •  05-14-2008, 5:44 PM Post no. 12280 in reply to 12260

    Re: DataBinding in DatePicker outside grid

    <DockPanel>
     <xcdg:DatePicker DateTimeMaskMode="ShortDate"
                      SelectedDate="{Binding ElementName=OrdersGrid, Path=CurrentItem[BirthDate], Mode=TwoWay}"
                      DockPanel.Dock="Top"/>


     <xcdg:DataGridControl x:Name="OrdersGrid"
                           ItemsSource="{Binding Source={StaticResource cvs_orders}}"/>
    </DockPanel>

    Where the grid is bound to a DataGridCollectionViewSource who is bound to the Employees table of the Northwind database. 


    Technical Writer - Xceed Software

    Of all the things I've lost, I miss my mind the most. - Mark Twain
    Filed under:
  •  05-15-2008, 4:13 AM Post no. 12290 in reply to 12280

    Re: DataBinding in DatePicker outside grid

    Thanks! That did the trick. If you're looking for something to add to the doc, that would make a nice example for the DatePicker.
  •  05-15-2008, 8:19 AM Post no. 12294 in reply to 12290

    Re: DataBinding in DatePicker outside grid

    Noted Smile
    Technical Writer - Xceed Software

    Of all the things I've lost, I miss my mind the most. - Mark Twain
View as RSS news feed in XML
Contact | Site Map | Reviews | Legal Terms of Use | Trademarks | Privacy Statement Copyright 2008 Xceed Software Inc.