GrapeCity MultiRow Windows Forms Documentation
IEditingCell Interface
Members  Example 


Defines common functionality for a cell that allows the manipulation of its value.
Syntax
<EditorBrowsableAttribute(EditorBrowsableState.Advanced)>
Public Interface IEditingCell 
Dim instance As IEditingCell
[EditorBrowsable(EditorBrowsableState.Advanced)]
public interface IEditingCell 
Remarks

This interface is implemented by classes such as CheckBoxCell, TrackBarCell, and RadioGroupCell that derive from Cell and provide a user interface (UI) for specifying values without hosting an editing control. In this case, the cell EditType property is set to a null reference (Nothing in Visual Basic).

Other cell types, such as ButtonCell, provide a UI but do not store user-specified values. In this case, the cell type does not implement IEditingCell or host an editing control.

Cell types that display an editing control when the cell is in edit mode, such as TextBoxCell, do not implement IEditingCell but instead provide a companion class that implements IEditingControl. For example, TextBoxCell provides a TextBoxEditingControl that derives from the System.Windows.Forms.TextBox control and implements IEditingControl. In this case, the cell EditType property is set to a Type object representing the editing control type.

Example
The following code example shows how to customize IEditingCell. This demo customizes an editable progress bar cell. By default, a progress bar cell can only be displayed. After implementing the IEditingCell interface, you can edit the progress bar cell's value by clicking the mouse, dragging the mouse, or pressing a keyboard key.
using System;
using System.Windows.Forms;
using System.Collections.Generic;
using System.Drawing;

namespace GrapeCity.Win.MultiRow.SampleCode
{
    public class EditedProgressBarCell : ProgressBarCell , IEditingCell
    {
        public EditedProgressBarCell()
        {
            // Initialize the cell, set read-only property to false to make the cell editable.
            this.ReadOnly = false;
        }

        int _editingValue = 0;

        public override Type EditType
        {
            get
            {
                // editing cell's edit type should be null.
                return null;
            }
        }
Imports System
Imports System.Windows.Forms
Imports System.Drawing
Imports GrapeCity.Win.MultiRow

Public Class EditedProgressBarCell
    Inherits ProgressBarCell
    Implements IEditingCell
    Public Sub New()
        ' Initialize the cell, set read-only property to false to make the cell editable.
        Me.ReadOnly = False
    End Sub

    Private _editingValue As Integer = 0

    Public Overloads Overrides ReadOnly Property EditType() As Type
        Get
            ' editing cell's edit type should be null.
            Return Nothing
        End Get
    End Property
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

IEditingCell Members
GrapeCity.Win.MultiRow Namespace
Cell Class
CheckBoxCell Class
RadioGroupCell Class
TrackBarCell Class

 

 


Copyright © GrapeCity, inc. All rights reserved.