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. (Last updated on : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Regd---Justify Option in Richtextbox.

Thread ID:

Created:

Updated:

Platform:

Replies:

35231 Sep 27,2005 06:55 AM UTC Sep 28,2005 12:15 PM UTC WinForms 1
loading
Tags: GridControl
manohar
Asked On September 27, 2005 06:55 AM UTC

Hi There, Actually we want the fourth option Justify alignment apart from left,center,right alignments provided by Richtextbox.we have implemented it and succeded.The problem is I am using griddataboundgrid and one cell type is Richtext.If I set left,center,or right to the text in richtextbox even after losing the focus from the cell the text stays back in the selected alignment,where as if I set to Justify option , as soon as the cell looses the focus its not retaining justify option.May be this is the paint problem(OnDraw of GridRichTextboxcell of code).Please advice. Regards, Manohar.

Administrator [Syncfusion]
Replied On September 28, 2005 12:15 PM UTC

Hi Manohar, it sounds as if the changes you made to the cell while it has focus were not saved into the cell. The proplem here is that GridDataBoundGrid only saves the cell value back as text and not the rich text codes into the underlying datasource. When the grid displays the rich text it uses the following code in its OnDraw method: rtf = style.Text; Rectangle clipBounds = GetCellBoundsCore(rowIndex, colIndex, true); Color backColor = Color.FromArgb(255, style.Interior.BackColor); RichTextPaint.DrawRichText(g, richTextBox, rtf, Grid.PrintingMode, Grid.GridBounds, textRectangle, clipBounds, backColor, style.WrapText, 100, Grid.IsRightToLeft()); So, in GridDataBoundGrid style.Text will only be the plain text (unless you store RTF in the datasource). What you would need to do this is format that text with RTF markup. Such formatting could be done in the QueryCellText event. Try subscribing to the event and modify the text cell contents there. Annother alternativ would be to handle the CellDraw event and call RichTextPaint.DrawRichText yourself. After drawing the cell contents set e.Handled = true. Stefan >Hi There, > > Actually we want the fourth option Justify alignment apart from left,center,right alignments provided by Richtextbox.we have implemented it and succeded.The problem is I am using griddataboundgrid and one cell type is Richtext.If I set left,center,or right to the text in richtextbox even after losing the focus from the cell the text stays back in the selected alignment,where as if I set to Justify option , as soon as the cell looses the focus its not retaining justify option.May be this is the paint problem(OnDraw of GridRichTextboxcell of code).Please advice. > >Regards, >Manohar. >

CONFIRMATION

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.

Warning Icon 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.Close Icon

;