Set culture on property grid field (RadDatePicker)

2 posts, 0 answers
  1. Naseem
    Naseem avatar
    70 posts
    Member since:
    Nov 2010

    Posted 06 May 2014 Link to this post

    Hi,
    I need to set culture on an editable property grid filed that is RadDatePicker.

    <telerik:PropertyDefinition Binding="{Binding MarkerDate,Converter={StaticResource DateOnlyConverter},Mode=TwoWay}">
                        <telerik:PropertyDefinition.EditorTemplate>
                            <DataTemplate>
                                <telerik:RadDatePicker telerik:AutoBindBehavior.UpdateBindingOnElementLoaded="Value" Culture="{Binding Source={StaticResource PresentationManager}, Path=Culture}"/>
                            </DataTemplate>
                        </telerik:PropertyDefinition.EditorTemplate>
                    </telerik:PropertyDefinition>
                </telerik:RadPropertyGrid.PropertyDefinitions>


    DateOnlyConverter convert the date to specific format. for example 'MM/dd/YYYY'
    Culture is set to RadDatePicker. For example 'en-US'

    However this code crashes and it seems it has got something to do with AutoBindbehavior , because the above setting works fine in whole of the project except in PropertyGrid. If I remove AutoBindBehavious it won't crash but the code doesn't work as expected.

    Your help is greatly appreciated,

  2. Boris
    Admin
    Boris avatar
    276 posts

    Posted 08 May 2014 Link to this post

    Hello Naseem,

    I attached a sample project based on your code snippet that uses AutoBindBehavior and shows a different Culture in the RadDatePicker in the EditorTemplate. However, I'm not sure I understand what you have in mind. If this is not what you are looking for could you please provide us with more information about your scenario and modify the sample project in a way that it reproduces the exception ?

    We are looking forward to your reply.

    Regards,
    Boris Penev
    Telerik
     
    Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
     
  3. DevCraft banner
Back to Top