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

how do I set the input language of a gridviewcell?

3 Answers 152 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Ori Tidhar
Top achievements
Rank 1
Ori Tidhar asked on 30 Aug 2010, 02:44 PM
I need that the input language will hebrew and that text will be entered from right to left.
I have tried the following solutions but none of them works:

1. setting the properties of the RadGridview and the relevant column:

InputLanguageManager.InputLanguage

 

="he-IL" Language="he-IL"

 

FlowDirection

 

="RightToLeft"

 

 

 

2. setting the above properties of the relevant cell in the BeginningEdit event.

 

private

 

void RadGridView1_BeginningEdit(object sender, GridViewBeginningEditRoutedEventArgs e)

 

{

    e.Cell.Language = System.Windows.Markup.

XmlLanguage.GetLanguage("he-IL");

 

    e.Cell.FlowDirection =

FlowDirection.RightToLeft;

 

 

    InputLanguageManager.SetInputLanguage(e.Cell, System.Globalization.CultureInfo.GetCultureInfoByIetfLanguageTag("he-IL"));

 

}

 

I'm using RadGridView version: 2009.2.911.35
Thanks.

3 Answers, 1 is accepted

Sort by
0
Maya
Telerik team
answered on 30 Aug 2010, 03:09 PM
Hi Ori Tidhar,

You can easily set the text-direction using the property of the grid - FlowDirection and set it to the desired value - in your case "RightToLeft". You may find an example for localization of the grid as well as setting the FlowDirection in our demos. As for managing the language of your application, you need to use the LocalizationManager and define its DefaultResourceManager property. I am sending you a sample project illustrating how to set RadGridView in German using Resource files.


Best wishes,
Maya
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Ori Tidhar
Top achievements
Rank 1
answered on 30 Aug 2010, 03:55 PM
Hi Maya,

Thanks for the prompt response. I'm afraid its not what I was looking for.
What I need is when I double-click a cell in the gridview I wish that the text I insert will be in hebrew and from right to left.

I was able to do it with a textbox but not with the RadgridView - does the gridviewcell contain an underlying textbox?

Thanks,

Ori.
0
Maya
Telerik team
answered on 30 Aug 2010, 04:22 PM
Hi Ori Tidhar,

In case I understand you correctly, you require the FlowDirection of the cell to be "RightToLeft" when it is in edit-mode. If that is the case, you can use the CellEditTemplate and predefine it in the way you want. 
For example:
<telerik:GridViewDataColumn DataMemberBinding="{Binding Name}">
 <telerik:GridViewDataColumn.CellEditTemplate>
 <DataTemplate>
  <TextBlock  Text="{Binding Name}" FlowDirection="RightToLeft" />     </DataTemplate>
 </telerik:GridViewDataColumn.CellEditTemplate>
</telerik:GridViewDataColumn>

However, setting up the Property of RadGridView FlowDirection to the desired value will result in setting up the direction for the whole grid no matter if it is in edit-mode or not.
I hope that helps.

 

Kind regards,
Maya
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
GridView
Asked by
Ori Tidhar
Top achievements
Rank 1
Answers by
Maya
Telerik team
Ori Tidhar
Top achievements
Rank 1
Share this question
or