GrapeCity MultiRow Windows Forms Documentation
Cell Note

The GcMultiRow control provides the functionality of cell notes. By adding cell notes, you can display additional information on the grid.

Using Code

This example uses the CellNote class to add a cell note to a cell.

[VB]

GcMultiRow1.CurrentCell.Note = New GrapeCity.Win.MultiRow.CellNote()

[CS]

gcMultiRow1.CurrentCell.Note = new GrapeCity.Win.MultiRow.CellNote();

Start Editing a Cell Note

You can use the GcMultiRow.BeginEditCellNote method to start editing a cell note that is added to the cell.

Using Code

This example starts editing a cell note.

[VB]

Dim pos As GrapeCity.Win.MultiRow.CellPosition = GcMultiRow1.CurrentCellPosition 
Dim cell As GrapeCity.Win.MultiRow.Cell = GcMultiRow1.CurrentCell 
If cell.Note IsNot Nothing Then
GcMultiRow1.BeginEditCellNote(pos) 
End If

[CS]

GrapeCity.Win.MultiRow.CellPosition pos = gcMultiRow1.CurrentCellPosition;
GrapeCity.Win.MultiRow.Cell cell = gcMultiRow1.CurrentCell; 
if (cell.Note != null) 
{ 
gcMultiRow1.BeginEditCellNote(pos); 
}

Removing Cell Notes

Set Null as a value in the Cell.Note property to remove a cell note that is added to the cell.

Using Code

This example removes a cell note.

[VB]

Dim cell As GrapeCity.Win.MultiRow.Cell = GcMultiRow1.CurrentCell 
If cell.Note IsNot Nothing 
Then cell.Note = Nothing 
End If

[CS]

GrapeCity.Win.MultiRow.Cell cell = gcMultiRow1.CurrentCell; 
if (cell.Note != null) 
{ cell.Note = null; 
}

Setting the Display Mode of a Cell Note

Use the CellNote.DisplayMode property to set the display mode of a cell note.

Using Code

This example sets the display mode of a cell note.

[VB]

Imports GrapeCity.Win.MultiRow 
Dim cell As GrapeCity.Win.MultiRow.Cell = GcMultiRow1.CurrentCell 
If Cell.Note IsNot Nothing Then
If cell.Note.DisplayMode = CellNoteDisplayMode.AlwaysShown Then 
cell.Note.DisplayMode = CellNoteDisplayMode.HoverShown 
Else 
cell.Note.DisplayMode = CellNoteDisplayMode.AlwaysShown 
End If 
End If

[CS]

using GrapeCity.Win.MultiRow; 
Cell cell = gcMultiRow1.CurrentCell;
if (cell.Note != null) 
{ 
if (cell.Note.DisplayMode == CellNoteDisplayMode.AlwaysShown) 
{ 
cell.Note.DisplayMode = CellNoteDisplayMode.HoverShown; 
} else {
cell.Note.DisplayMode = CellNoteDisplayMode.AlwaysShown; 
} 
}

Setting the Style of a Cell Note

Use the CellNote.Style property to set the style of a cell note.

Setting Style of Cell Note

Using Code

This example sets the cell note style.

[VB]

Imports GrapeCity.Win.MultiRow 
Dim cellNote As CellNote = New CellNote() 
cellNote.Style.BackColor = Color.Azure
cellNote.Style.ForeColor = Color.Blue 
cellNote.Text = "Cell Note" 
' Border style 
cellNote.Style.LineColor = Color.Red 
cellNote.Style.LineStyle = CellNoteLineStyle.Thin 
cellNote.Style.LineWidth = 5 
' Color of the triangle symbol 
cellNote.Style.TriangleSymbolColor = Color.Blue 
' Shadow display
cellNote.Style.ShowShadow = MultiRowTriState.True 
GcMultiRow1.CurrentCell.Note = cellNote

[CS]

using GrapeCity.Win.MultiRow;
CellNote cellNote = new CellNote(); 
cellNote.Style.BackColor = Color.Azure; 
cellNote.Style.ForeColor = Color.Blue; 
cellNote.Text = "Cell Note"; 
// Border style
cellNote.Style.LineColor = Color.Pink; 
cellNote.Style.LineStyle = CellNoteLineStyle.Thin; 
cellNote.Style.LineWidth = 5; 
// Color of the triangle symbol
cellNote.Style.TriangleSymbolColor = Color.Blue; 
// Shadow display 
cellNote.Style.ShowShadow = MultiRowTriState.True; 
gcMultiRow1.CurrentCell.Note = cellNote;

Style Application Rules for a Cell Note

If the Style property of the cell note is not null, the setting value of the GcMultiRow.DefaultCellNoteStyle property is applied, if the following values ​​are set for each property; otherwise, the value that is set for each property, is applied.

Property Setting Value
BackColor
ForeColor
PatternColor
LineColor
TriangleSymbolColor
Color.Empty
Font
BackgroundImage
ContextMenuStrip
Null
LineAdjustment
TextEffect
Multiline
PatternStyle
TextAdjustment
TextAlign
TextVertical
BackgroundImageLayout
BackgroundGradientEffect
UseCompatibleTextRendering
WordWrap
LineStyle
ShowShadow
Inherit
Padding (-1,-1,-1,-1)
TextAngle
LineWidth
float.NaN
BackgroundImageOpacity double.NaN
TextIndent -1

The default values of the GcMultiRow.DefaultCellNoteStyle property are as follows.

Property Default Value
BackColor LightYellow
ForeColor Setting value of the ForeColor property of the GcMultiRow control
Font Setting value of the Font property of the GcMultiRow control
BackgroundGradientEffect Null
Direction Center
BackgroundImage Null
BackgroundImageLayout Tile
BackgroundImageOpacity 1
LineAdjustment None
Multiline True
Padding (0,0,0,0)
PatternColor WindowText
PatternStyle None
TextAdjustment Near
TextAlign TopLeft
TextAngle 0
TextEffect Flat
TextIndent 0
TextVertical False
UseCompatibleTextRendering False
WordWrap True
LineColor Color.Black
LineStyle Thin
LineWidth 1
ShowShadow Ture
ContextMenuStrip Null
TriangleSymbolColor Color.Red

Creating Cell Notes

Use the Cell.Note property to add a cell note to a cell.

  • The Edit control for cell notes does not support the rich text format.
  • You can only set the cell note at runtime. An exception is thrown if you add a cell note at design time.
  • You can set only one cell note in a cell. An exception is thrown if the same cell note is set to multiple cells.
  • It is not possible to add cell notes to a new row that has not been committed.
See Also

 

 


Copyright © GrapeCity, inc. All rights reserved.

Support Options