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.
Unfortunately, activation email could not send to your email. Please try again.

GDBG - GridDropDownMonthCalendarCellModel text flow direction

Thread ID:





67728 Aug 29,2007 03:40 AM Sep 4,2007 10:22 AM Windows Forms 1
Tags: GridControl
Miki Watts
Asked On August 29, 2007 03:40 AM

I'm using version

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)

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

Golda Rebecal [Syncfusion]
Replied On September 4, 2007 10:22 AM

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:

Kindly let me know if this helps you.

Best regards,


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.