GrapeCity MultiRow Windows Forms Documentation
CellStyle Property (EditingControlShowingEventArgs)
Example 


Gets or sets the cell style of the edited cell.
Syntax
Public Property CellStyle As CellStyle
Dim instance As EditingControlShowingEventArgs
Dim value As CellStyle
 
instance.CellStyle = value
 
value = instance.CellStyle
public CellStyle CellStyle {get; set;}

Property Value

A CellStyle value that represents the style of the cell being edited.
Exceptions
ExceptionDescription
System.ArgumentNullExceptionThe specified value when setting this property is a null reference (Nothing in Visual Basic).
Example
The following code example shows how to initialize the editing control. This code example is part of a larger example provided for the GcMultiRow.EditingControlShowing event.
void gcMultiRow_EditingControlShowing(object sender, EditingControlShowingEventArgs e)
        {
            // Change editing control's backcolor.
            e.CellStyle.BackColor = Color.Red;

            TextBox textBox = e.Control as TextBox;

            if (textBox != null)
            {
                // Add TextChange event handler.
                textBox.TextChanged -= new EventHandler(textBox_TextChanged);
                textBox.TextChanged += new EventHandler(textBox_TextChanged);
            }
        }
Private Sub gcMultiRow_EditingControlShowing(ByVal sender As Object, ByVal e As EditingControlShowingEventArgs) Handles gcMultiRow.EditingControlShowing
        ' Change editing control's backcolor.
        e.CellStyle.BackColor = Color.Red

        Dim textBox As TextBox = TryCast(e.Control, TextBox)

        If Not textBox Is Nothing Then
            ' Add TextChange event handler.
            RemoveHandler textBox.TextChanged, AddressOf textBox_TextChanged
            AddHandler textBox.TextChanged, AddressOf textBox_TextChanged
        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

EditingControlShowingEventArgs Class
EditingControlShowingEventArgs Members

 

 


Copyright © GrapeCity, inc. All rights reserved.