GrapeCity MultiRow Windows Forms Documentation
ShowWaveLine Property
Example 


Gets or sets a value that indicates whether to display a line in the cell.
Syntax
<BrowsableAttribute(False)>
<DefaultValueAttribute()>
Public Property ShowWaveLine As Boolean
Dim instance As Cell
Dim value As Boolean
 
instance.ShowWaveLine = value
 
value = instance.ShowWaveLine
[Browsable(false)]
[DefaultValue()]
public bool ShowWaveLine {get; set;}

Property Value

true if the cell can display lines; otherwise, false. The default is false.
Remarks

Set this property to true to display an underline at the bottom of the cell.

You can use this property with the cell's ToolTipText property when you need to show error information to the user. Set this property to true and set the ToolTipText to the error string. An underline is then displayed at the bottom of the cell. When the pointer is over the cell, the ToolTipText is displayed. Also, you can change the underline's color using the WaveLineColor property. If you want to display the underline in edit mode, set GcMultiRow's GcMultiRow.ShowWaveLineInEditingStatus property to true.

Example
The following code example shows how to use this property to notify a user of a cell error. To run this example, create a windows form, and add a GcMultiRow control to the form. Add a NumericUpDownCell named "Age" to the MultiRow controls template. Add the event handle of this event and copy the following code into the event handler. Input an invalid value and try to leave the cell.
void gcMultiRow_CellValidating(object sender, CellValidatingEventArgs e)
        {
            if (e.CellName == "Age")
            {
                int age = int.Parse(e.FormattedValue.ToString());
                if (age < 0 || age > 100)
                {
                    e.Cancel = true;

                    // Show a wave line to notify the user there are errors.
                    this.gcMultiRow1[e.RowIndex, e.CellIndex].ShowWaveLine = true;

                    this.gcMultiRow1.EndEdit();
                }
                else
                {
                    this.gcMultiRow1[e.RowIndex, e.CellIndex].ShowWaveLine = false;
                }
            }
        }
Private Sub gcMultiRow2_CellValidating(ByVal sender As Object, ByVal e As CellValidatingEventArgs)
        If e.CellName = "Age" Then
            Dim age As Integer = Integer.Parse(e.FormattedValue.ToString())
            If age < 0 OrElse age > 100 Then
                e.Cancel = True

                ' Show a wave line to notify user, there are some errors.
                Me.gcMultiRow1(e.RowIndex, e.CellIndex).ShowWaveLine = True

                Me.gcMultiRow1.EndEdit()
            Else
                Me.gcMultiRow1(e.RowIndex, e.CellIndex).ShowWaveLine = False
            End If
        End If
    End Sub
Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

Cell Class
Cell Members
WaveLineColor Property
ShowWaveLineInEditingStatus Property

 

 


Copyright © GrapeCity, inc. All rights reserved.