This is a migrated thread and some comments may be shown as answers.

isEditable property in app.xaml and Localization

5 Answers 18 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Kourosh
Top achievements
Rank 1
Kourosh asked on 30 May 2014, 09:23 PM
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!

5 Answers, 1 is accepted

Sort by
0
Kalin
Telerik team
answered on 02 Jun 2014, 11:06 AM
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.
 
0
Kourosh
Top achievements
Rank 1
answered on 02 Jun 2014, 11:13 AM
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 :)
0
Kalin
Telerik team
answered on 02 Jun 2014, 11:55 AM
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.
 
0
Kourosh
Top achievements
Rank 1
answered on 02 Jun 2014, 12:38 PM
It works, and even better, I can extend it the way I want... I learned something new...
Thanks Kalin for your nice support :)
0
Kalin
Telerik team
answered on 03 Jun 2014, 06:51 AM
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.
 
Tags
ComboBox
Asked by
Kourosh
Top achievements
Rank 1
Answers by
Kalin
Telerik team
Kourosh
Top achievements
Rank 1
Share this question
or