You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+7-5Lines changed: 7 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,8 +1,10 @@
1
-
# How to display rich text in WinForms DataGrid (SfDataGrid)?
2
-
This example explains how to display rich text in [WinForms DataGrid](https://www.syncfusion.com/winforms-ui-controls/datagrid) (SfDataGrid).
1
+
# How to display rich text in WinForms DataGrid?
2
+
This example explains how to display rich text in WinForms DataGrid.
3
3
4
4
[WinForms DataGrid](https://www.syncfusion.com/winforms-ui-controls/datagrid) (SfDataGrid) doesn't have direct support to display RichText’s in the [GridTextColumn](https://help.syncfusion.com/cr/windowsforms/Syncfusion.WinForms.DataGrid.GridTextColumn.html). However, it is possible to achieve this by overriding the [OnRender](https://help.syncfusion.com/cr/windowsforms/Syncfusion.WinForms.DataGrid.Renderers.GridTextBoxCellRenderer.html#Syncfusion_WinForms_DataGrid_Renderers_GridTextBoxCellRenderer_OnRender_System_Drawing_Graphics_System_Drawing_Rectangle_System_String_Syncfusion_WinForms_DataGrid_Styles_CellStyleInfo_Syncfusion_WinForms_DataGrid_DataColumnBase_Syncfusion_WinForms_GridCommon_ScrollAxis_RowColumnIndex_) method in [GridTextBoxCellRenderer](https://help.syncfusion.com/cr/windowsforms/Syncfusion.WinForms.DataGrid.Renderers.GridTextBoxCellRenderer.html).
5
5
6
+
### C#
7
+
6
8
```c#
7
9
//customize the TextBoxCellRenderer
8
10
this.sfDataGrid1.CellRenderers.Remove("TextBox");
@@ -24,6 +26,8 @@ public class GridRichTextCellRenderer : GridTextBoxCellRenderer
24
26
25
27
```
26
28
29
+
### VB
30
+
27
31
```VB
28
32
'customize the TextBoxCellRenderer
29
33
Me.sfDataGrid1.CellRenderers.Remove("TextBox")
@@ -46,7 +50,5 @@ End Class
46
50
47
51

48
52
49
-
You can download the example from [GitHub](https://github.com/SyncfusionExamples/How-to-display-rich-text-in-WinForms-DataGrid-SfDataGrid-)
0 commit comments