Category / Section
How to use the superscript option for the text box cell in the WinForms GridGroupingControl?
1 min read
Superscript
You can use Superscript by setting the CellType to RichText and setting cellvalue as RTF text.
C#
void gridGroupingControl1_QueryCellStyleInfo(object sender, Syncfusion.Windows.Forms.Grid.Grouping.GridTableCellStyleInfoEventArgs e) { if (e.TableCellIdentity.Column != null && e.TableCellIdentity.Column.Name == "City" && e.TableCellIdentity.DisplayElement.Kind == Syncfusion.Grouping.DisplayElementKind.Record) { string rtf = @"{\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\fnil\fcharset0 Microsoft Sans Serif;}} \viewkind4\uc1\pard\f0\fs17 Syncfusion\up15 2\up0\par}"; //declare celltype as RichTextBox e.Style.CellType = GridCellTypeName.RichText; e.Style.CellValue = rtf; } }
VB
Private Sub gridGroupingControl1_QueryCellStyleInfo(ByVal sender As Object, ByVal e As Syncfusion.Windows.Forms.Grid.Grouping.GridTableCellStyleInfoEventArgs) If e.TableCellIdentity.Column IsNot Nothing AndAlso e.TableCellIdentity.Column.Name = "City" AndAlso e.TableCellIdentity.DisplayElement.Kind Is Syncfusion.Grouping.DisplayElementKind.Record Then Dim rtf As String = "{\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\fnil\fcharset0 Microsoft Sans Serif;}} \viewkind4\uc1\pard\f0\fs17 Syncfusion\up15 2\up0\par}" 'declare celltype as RichTextBox e.Style.CellType = GridCellTypeName.RichText e.Style.CellValue = rtf End If End Sub
The following screenshot displays the Grid after applying the properties.
Samples:
C#: Superscript
VB: Superscript