We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

GDBG - GridDropDownMonthCalendarCellModel text flow direction

I'm using version 4.4.0.5

I'm using a right to left GDBG, and I have a date cell in it, using the GridDropDownMonthCalendarCellModel for the cell model, and a GridMaskEditCellRenderer for the cell renderer.

I can get the mask to show aligned to the right, but when you start entering text into it, the text start from right to left.

This is what I do in overriding the OnPrepareViewStyleInfo in the renderer:
public override void OnPrepareViewStyleInfo(GridPrepareViewStyleInfoEventArgs e)
{
base.OnPrepareViewStyleInfo(e);

e.Style.RightToLeft = RightToLeft.No;
e.Style.HorizontalAlignment = GridHorizontalAlignment.Right;
e.Style.TextAlign = GridTextAlign.Left;
}

The same code has been working just fine for me when I use it with a regular MaskedTextBox that's not in a grid.

I need to make the text in the grid cell start from the left, even though the grid is set to RightToLeft.Yes

1 Reply

GR Golda Rebecal Syncfusion Team September 4, 2007 02:22 PM UTC

Hi Miki,

Sorry for the delay in responding.

GridTextAlign is used to align the text when image and text is present in the cell. GridHorizontalAlignment is used for horizontal alignment of contents in the cell. Hence in order to make the text in the cell start from left, you can set HorizontalAlignment to Left in the PrepareViewStyleInfo event.

Please refer to the attached sample that illustrates the same:
http://websamples.syncfusion.com/samples/Grid.Windows/F67728/main.htm

Kindly let me know if this helps you.

Best regards,
Golda

Loader.
Live Chat Icon For mobile
Up arrow icon