Category / Section
How to set tooltip for cells in WinForms GridListControl?
1 min read
Tooltip
The Tooltip can be set for the cells using CellTipText property and this property can be set by handling the QueryCellInfo event in GridListControl.
C#
//Event subscription. this.gridListControl1.Grid.QueryCellInfo += Grid_QueryCellInfo; //Handling the QueryCellInfo event. private void Grid_QueryCellInfo(object sender, GridQueryCellInfoEventArgs e) { if (e.RowIndex != 0) e.Style.CellTipText = e.Style.CellValue.ToString(); }
VB
'Event subscriptions. Me.gridListControl1.Grid.QueryCellInfo += Grid_QueryCellInfo 'Handling the QueryCellInfo event. Private Sub Grid_QueryCellInfo(ByVal sender As Object, ByVal e As GridQueryCellInfoEventArgs) If e.RowIndex <> 0 Then e.Style.CellTipText = e.Style.CellValue.ToString() End If End Sub
Screenshot
Samples:
C#: Tooltip
VB: Tooltip