Culture Error when use RadMaskedTextBox inside GridViewDataColumn

3 posts, 0 answers
  1. Sha
    Sha avatar
    7 posts
    Member since:
    Nov 2012

    Posted 20 Nov 2012 Link to this post

    Hi,

    GridViewDataColumn have the value is 300,00.
    Set Culture property to "fr-FR" of RadMaskedTextBox in XAML view.
    On runtime, I click on that field to change to inline editing mode
    => RadMaskedTextBox display 300,00 --> correct

     

    <telerik:GridViewDataColumn DataMemberBinding="{Binding MyValue, 
                                        Converter
    ={StaticResource EmptyToZeroConverter}}">

        <telerik:GridViewDataColumn.CellEditTemplate>

           <DataTemplate>

              <telerik:RadMaskedTextBox Value="{Binding MyValue, 
                              Converter
    ={StaticResource EmptyToZeroConverter}, Mode=TwoWay}" 
                      Mask
    ="n" MaskType="Numeric"

                       Culture="fr-FR"

                       />

           </DataTemplate>

        </telerik:GridViewDataColumn.CellEditTemplate>

     </telerik:GridViewDataColumn>

    But,
    when set binding to Culture property of RadMaskedTextBox in XAML view.
    On runtime, I click on that field to change to inline editing mode
    => RadMaskedTextBox display 30 000,00 --> incorrect

    <

    telerik:GridViewDataColumn DataMemberBinding="{Binding MyValue, 
                                         Converter
    ={StaticResource EmptyToZeroConverter}}">

        <telerik:GridViewDataColumn.CellEditTemplate>

           <DataTemplate>

              <telerik:RadMaskedTextBox Value="{Binding MyValue, 
                                Converter
    ={StaticResource EmptyToZeroConverter}, Mode=TwoWay}" 
                      Mask
    ="n" MaskType="Numeric"

                       Culture="{Binding DataContext.SelectedCurrencyCulture, 
                               RelativeSource
    ={RelativeSource AncestorType
    =telerik:RadWindow}}"

                       />

           </DataTemplate>

        </telerik:GridViewDataColumn.CellEditTemplate>

     </telerik:GridViewDataColumn>

      

     

    When I use RadMaskedTextBox outside GridView and set binding to Culture, RadMaskedTextBox work correct.

    <telerik:RadMaskedTextBox Value="{Binding MyValue, 
                       Converter
    ={StaticResource EmptyToZeroConverter}, Mode=TwoWay}" 
             Mask
    ="n" MaskType="Numeric"

     

             Culture="{Binding DataContext.SelectedCurrencyCulture, 
                       RelativeSource
    ={RelativeSource AncestorType
    =telerik:RadWindow}}"

              />

     

    Admin please help me to resolve this problem ASAP. I really need it...
    Thanks you so much,
    Sha Daw.






  2. Dimitrina
    Admin
    Dimitrina avatar
    3769 posts

    Posted 20 Nov 2012 Link to this post

    Hi,

    It seems that the culture is not resolved. The problem should be because of the RelativeSource you have used for the binding. Please expose the source as a Static Resource and specify the source through it.

    All the best,
    Didie
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  3. Sha
    Sha avatar
    7 posts
    Member since:
    Nov 2012

    Posted 20 Nov 2012 Link to this post

    Hi,

    How can i expose the source as a Static Resource? I have tried this way... but it cannot find Resource with Key/Name MyWindow...?

    <telerik:RadWindow x:Key="MyWindow">
        <telerik:RadGridView>

          <telerik:RadGridView.Columns>

            <telerik:GridViewDataColumn DataMemberBinding="{Binding MyValue, 
                                    Converter
    ={StaticResource EmptyToZeroConverter}}">

               <telerik:GridViewDataColumn.CellEditTemplate>

                  <DataTemplate>

                     <telerik:RadMaskedTextBox Value="{Binding MyValue, 
                                Converter
    ={StaticResource EmptyToZeroConverter}, Mode=TwoWay}" 
                           Mask
    ="n" MaskType="Numeric" 
                           Culture="{Binding DataContext.SelectedCurrencyCulture,

                                                                                       Source={StaticResource MyWindow}}"

                               />

                  </DataTemplate>

               </telerik:GridViewDataColumn.CellEditTemplate>

            </telerik:GridViewDataColumn
               </telerik:RadGridView.Columns>

         </telerik:RadGridView>

     </telerik:RadWindow>

     

     

    Please help me to resolve this problem ASAP. I really need it...
    Thanks you so much,
    Sha Daw.

Back to Top