I have a GDBD and I would like to change the system keyboard input language from english to arabic when the user click a cell which has got the Right-To-Left style set to true, i would like to know which event is best to perform this action (CurrentCellChanging,CellClick,etc...), am using vb.net
ADAdministrator Syncfusion Team February 1, 2005 12:47 PM UTC
I would try the CurrentCellControlGotFocus event. The control is passed in as e.Control.
OPOsden PereiraFebruary 2, 2005 10:28 AM UTC
We tried the event you had mentioned and also some other events, but the problem is, whenever a column is clicked or moved to, the first character is typed in the other language,
example:if i move from a normal english field(left-to-right) to an arabic field(right-to left)
the first character typed in the cell id english & then it types the rest in arabic & vice-versa. here is the code:
Dim Ci As CultureInfo
Public Sub CurrentCellControlGotFocus(ByVal sender As Object, ByVal e As System.Windows.Forms.ControlEventArgs)
If CType(sender, GridDataBoundGrid).Binder.InternalColumns(CType(sender, GridDataBoundGrid).CurrentCell.ColIndex).StyleInfo.RightToLeft = RightToLeft.Yes Then
System.Windows.Forms.InputLanguage.CurrentInputLanguage = InputLanguage.FromCulture(Ci.CreateSpecificCulture("ar-SA"))
System.Windows.Forms.InputLanguage.CurrentInputLanguage = InputLanguage.FromCulture(Ci.CreateSpecificCulture("en-US"))
Catch Ex As Exception
ADAdministrator Syncfusion Team February 2, 2005 10:42 AM UTC
CurrentCellGotFocus is normally raised only after the first key was pressed.
I see two alternative options:
- You can set Grid.Model.Options.ActivateCurrentCellBehavior = GridCellActivateAction.SetCurrent. The CurrentCellGotFocus will be raised as soon as the current cell was moved.
- You can try handling the CurrentCellActivated event. That gets called right after the current cell was moved. At the time this event is called the textbox is not yet visible. The text will still be drawn static. The event is raised before the first key is pressed.
One more thing: If you run into any trouble with the RichTextBox used inside cells set grid.Model.Options.UseRightToLeftCompatibleTextBox