Articles in this section

How to use the superscript option for the text box cell in the WinForms GridGroupingControl?

Superscript


You can use Superscript by setting the CellType to RichText and setting cellvalue as RTF text.


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

Show the superscript in textbox cell


Samples:

C#: Superscript

VB: Superscript

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Access denied
Access denied