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: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to set Unbound Field style

Thread ID:





31995 Jul 19,2005 05:53 PM UTC Jul 19,2005 07:37 PM UTC WinForms 1
Tags: Grouping
Administrator [Syncfusion]
Asked On July 19, 2005 05:53 PM UTC

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

Administrator [Syncfusion]
Replied On 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.##"; >}


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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

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