isEditable property in app.xaml and Localization

6 posts, 0 answers
  1. Kourosh
    Kourosh avatar
    3 posts
    Member since:
    Feb 2014

    Posted 30 May 2014 Link to this post

    Hi,
    Let's say I have a RadGridView and want to localize it... then I use CustomLocalization and everything is working as everyone expected... now the problem is when I style the RadComboBox in app.xaml ((without key, cause I want it to apply to every RadComboBox)) like this :

            <Style TargetType="telerik:RadComboBox">
                <Setter Property="IsReadOnly"
                        Value="True" />
                <Setter Property="OpenDropDownOnFocus"
                        Value="True" />
                <Setter Property="IsEditable"
                        Value="True" />
            </Style>

    And after that the gridview filters won't changed their strings... they work and ComboBox items in filters have proper strings(localized strings) but the selecteditem in ComboBox has not changed!!!!
    the problem is with IsEditable, because after I delete it, it shows well localized strings...
    if I have to bring any more information, please tell me... and finally thanks for the great components!
  2. Kalin
    Admin
    Kalin avatar
    1207 posts

    Posted 02 Jun 2014 Link to this post

    Hi Kourosh,

    What I can suggest you in order to avoid applying the global style to the ComboBoxes in the GridView would be to add another Style in the GridView Resources in order to overwrite the global Style. This way the ComboBoxes outside of the GridView will receive the Style from App.xaml and the ComboBoxes in the GridView will work as expected. Check the following code snippet:

    <telerik:RadGridView ...>
        <telerik:RadGridView.Columns>
            ...
        </telerik:RadGridView.Columns>
        <telerik:RadGridView.Resources>
            <Style TargetType="telerik:RadComboBox">
                <Setter Property="IsEditable" Value="False" />
            </Style>
        </telerik:RadGridView.Resources>
    </telerik:RadGridView>

    Please test it and let me know if this works for you.

    Regards,
    Kalin
    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. UI for WPF is Visual Studio 2017 Ready
  4. Kourosh
    Kourosh avatar
    3 posts
    Member since:
    Feb 2014

    Posted 02 Jun 2014 in reply to Kalin Link to this post

    Ofcourse it works with this workaround, but I have to do it in about 40 pages and 120 RadGridViews...
    Can you tell me another workaround, like how can I build a resource and tell all RadGridViews to use that resource...
    thanks :)
  5. Kalin
    Admin
    Kalin avatar
    1207 posts

    Posted 02 Jun 2014 Link to this post

    Hi Kourosh,

    The easiest solution I can suggest you for this scenario would be to inherit from RadComboBox and use the custom ComboBox in the application instead of RadComboBox. This way only the custom ComboBox will receive the desired style (you will need to change the TargetType to CustomComboBox) and the ComboBoxes in the GridView won't be affected. The CustomComboBox class should look as shown below:

    public class CustomComboBox: RadComboBox
    {
    }

    And the Style in App.xaml:

    <Style TargetType="local:CustomComboBox">
        <Setter Property="IsReadOnly"
                Value="True" />
        <Setter Property="OpenDropDownOnFocus"
                Value="True" />
        <Setter Property="IsEditable"
                Value="True" />
    </Style>

    Hope this will work for you.

    Regards,
    Kalin
    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.
     
  6. Kourosh
    Kourosh avatar
    3 posts
    Member since:
    Feb 2014

    Posted 02 Jun 2014 in reply to Kalin Link to this post

    It works, and even better, I can extend it the way I want... I learned something new...
    Thanks Kalin for your nice support :)
  7. Kalin
    Admin
    Kalin avatar
    1207 posts

    Posted 03 Jun 2014 Link to this post

    Hi Kourosh,

    I'm glad this helped you to achieve the desired. If you have any further questions or concerns, please do not hesitate to contact us.

    Regards,
    Kalin
    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.
     
Back to Top
UI for WPF is Visual Studio 2017 Ready