[]
Represents the sort field by font color.
This ISortField implementation defines a sort condition based on the displayed font color of cells. It also uses SortOrder to specify where matching font colors are placed in the sorted range.
public interface IFontColorSortField : ISortField
Public Interface IFontColorSortField
Inherits ISortField
worksheet.Range["A1:B4"].Value = new object[,] {{"Name", "Score"}, {"A", 2}, {"B", 1}, {"C", 3}};
worksheet.Range["B2"].Font.Color = Color.Red;
worksheet.Range["B3:B4"].Font.Color = Color.Blue;
IFontColorSortField sortField = new FontColorSortField(worksheet.Range["B2:B4"], Color.Blue, SortOrder.Ascending);
worksheet.Sort.SortFields.Add(sortField);
worksheet.Sort.Range = worksheet.Range["A2:B4"];
worksheet.Sort.Orientation = SortOrientation.Columns;
worksheet.Sort.Apply();
| Name | Description |
|---|---|
| Color | Gets the font Color used as the sort criterion. This color is the font color criterion stored in the sort field and is used to match cells when sorting by font color. |
| Order | Gets the sort order. |