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
close icon

How to set Unbound Field style

I want to set Unbound Field style like this: if ((string)row["ValType"]=="1") { style.format="###0.##%"; } else { style.format="###0.##"; }

1 Reply

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.##"; >}

Loader.
Live Chat Icon For mobile
Up arrow icon