Articles in this section
Category / Section

How to have a HTML control within the WinForms GridGroupingControl cell?

1 min read

Add custom control

To have a HTML control within the GridGroupingControl cell, you have to make use of the control called HtmlUIControl.  By setting this control as a cell type of particular cell, you can have a HTML control within the Grid.

C#

string xhtml1;
byte[] byteArray;
MemoryStream stream;
Syncfusion.Windows.Forms.HTMLUI.HTMLUIControl htmluiControl1 = new Syncfusion.Windows.Forms.HTMLUI.HTMLUIControl();
htmluiControl1.AutoScroll = true;
htmluiControl1.LoadHTML(stream);
//Sets the column cell type as the HTML control.
GridColumnDescriptor column1 = this.gridGroupingControl1.TableDescriptor.GetColumnDescriptor("Column");//Specifies the Column name.
column1.Appearance.AnyRecordFieldCell.CellType = GridCellTypeName.Control;
column1.Appearance.AnyRecordFieldCell.Control = htmluiControl1;
column1.Width = 300;

VB

Dim xhtml1 As String
Dim byteArray() As Byte
Dim stream As MemoryStream
Dim htmluiControl1 As New Syncfusion.Windows.Forms.HTMLUI.HTMLUIControl()
htmluiControl1.AutoScroll = True
htmluiControl1.LoadHTML(stream)
'Sets the column cell type as the HTML control.
Dim column1 As GridColumnDescriptor = Me.gridGroupingControl1.TableDescriptor.GetColumnDescriptor("Column") 'Specifies the Column name.
column1.Appearance.AnyRecordFieldCell.CellType = GridCellTypeName.Control
column1.Appearance.AnyRecordFieldCell.Control = htmluiControl1
column1.Width = 300

The following image displays the HtmlUIControl cell type in the Grid Grouping control.

Show HTMLUi control in GridGroupingControl

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