How to have a HTML control within the WinForms GridGroupingControl cell?
Add custom control
To have
an HTML control within the WinForms GridGroupingControl cell,
you have to make use of the control called HtmlUIControl. By
setting this control as a cell type of a particular cell, you can have an 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 = 300The following image displays the HTMLUIControl cell type in the GridGroupingControl.
