AD
Administrator
Syncfusion Team
July 19, 2005 07:37 PM UTC
Hi Cradle,
you can do this using the QueryCellStyleInfo event.
Example:
private void gridGroupingControl1_QueryCellStyleInfo(object sender, GridTableCellStyleInfoEventArgs e)
{
GridTableCellStyleInfoIdentity id = e.TableCellIdentity;
Record r = id.DisplayElement is Record ? (Record) id.DisplayElement : id.DisplayElement.ParentRecord;
GridColumnDescriptor column = id.Column;
if (column != null && column.MappingName == "yourUnboundFieldName")
{
if ((int) r.GetValue("someColumn") > 1)
e.Style.Format = "yourFormat";
}
}
Stefan
>I want to set Unbound Field style like this:
>
>if ((string)row["ValType"]=="1")
>{
>
>style.format="###0.##%";
>}
>else
>{
>style.format="###0.##";
>}