2X faster development
The ultimate Xamarin UI toolkit to boost your development speed.
SfDataGrid displays all the text values in GridCells with a default Foreground color of RGB values 51. However SfDataGrid allows you to customize the Foreground color of the GridCells for the entire view and also to some specific cells based on conditions. To change the Foreground color of the GridCells for the entire view, you can use the SfDataGrid.GridStyle property and set the custom style to change the foreground color. For more details please refer our user documentation in the below link. http://help.syncfusion.com/xamarin/sfdatagrid/styles In case, if your requirement is to change the foreground color based on the cell value, then you can achieve this by using the CellStyle property in the GridColumn. You can write converters for the style properties based on your requirements. Refer the below code example in which foreground color of the StudentsMarks column is customized based on conditions written in the converter.
Refer the below code example for writing a converter to customize the cell foreground based on conditions.
Refer the following screenshot for the final outcome For more details about applying conditional styles for a column in SfDataGrid, please refer the below user documentation link. http://help.syncfusion.com/xamarin/sfdatagrid/conditional-styles-forms
You can download the working sample for this KB from the below link. http://www.syncfusion.com/downloads/support/directtrac/general/ze/Conditional_Styling579879886 |
2X faster development
The ultimate Xamarin UI toolkit to boost your development speed.
This page will automatically be redirected to the sign-in page in 10 seconds.