GridGdiPaint.Instance.DrawText problem

Hi,

I have a problem with the DrawText method in GDBG.

For each column I have set a format with the style.Format property.

In the DrawCellDisplayText event, the styleInfo Format is not set properly.
When I set the format in the style before calling the DrawText method ... it doesn't work : the cell format is not correctly set.

How can I resolve my problem ?

Thanks


1 Reply

HA haneefm Syncfusion Team July 16, 2007 03:53 PM UTC

Hi Simon,

You can use DrawCellDisplayText event and set the e.DispalyText to some new value to want to display. Here is a code snippet

private void gridDrawCellDisplayText(object sender, GridDrawCellDisplayTextEventArgs e)
{
if( e.ColIndex == 3 && e.RowIndex >0)
e.DisplayText = string.Format("{0:P}" , int.Parse(e.Style.CellValue.ToString( ) ) );
}

Best regards,
Haneef

Loader.
Up arrow icon