GrapeCity MultiRow Windows Forms Documentation
TextBoxCell Class
Members  Example 


Represents a Cell that displays editing text information in a GcMultiRow control.
Object Model
TextBoxCell ClassGcMultiRow ClassCellStyle ClassCellNote ClassSection ClassCellStyle ClassMultiRowTouchToolBar ClassValidatorCollection ClassCellValidator Class
Syntax
<ValueTypeEditorAttribute(TypeName="GrapeCity.Win.MultiRow.Design.MultiLineEditor, GrapeCity.Win.MultiRow, Version=7.20.20141.0, Culture=neutral, PublicKeyToken=0f7a722ee3c2bdd9", AavailableForNullValue=True)>
<ToolboxItemFilterAttribute(FilterString="GrapeCity.Win.MultiRow.Template7", FilterType=ToolboxItemFilterType.Custom Or  _
    ToolboxItemFilterType.Prevent Or  _
    ToolboxItemFilterType.Require)>
<FeatureAttribute(Name="Cell", Version="v5.0")>
<ToolboxBitmapAttribute()>
<SRDescriptionAttribute("Enables the user to enter text and provides multiline editing.")>
<DesignerAttribute(DesignerBaseTypeName="System.ComponentModel.Design.IDesigner", DesignerTypeName="GrapeCity.Win.MultiRow.Design.DataFieldAndValidatorCellDesigner,GrapeCity.Win.MultiRow.Design, Version=7.20.20141.0, Culture=neutral, PublicKeyToken=0f7a722ee3c2bdd9")>
Public Class TextBoxCell 
   Inherits Cell
Dim instance As TextBoxCell
[ValueTypeEditor(TypeName="GrapeCity.Win.MultiRow.Design.MultiLineEditor, GrapeCity.Win.MultiRow, Version=7.20.20141.0, Culture=neutral, PublicKeyToken=0f7a722ee3c2bdd9", AavailableForNullValue=true)]
[ToolboxItemFilter(FilterString="GrapeCity.Win.MultiRow.Template7", FilterType=ToolboxItemFilterType.Custom | 
    ToolboxItemFilterType.Prevent | 
    ToolboxItemFilterType.Require)]
[Feature(Name="Cell", Version="v5.0")]
[ToolboxBitmap()]
[SRDescription("Enables the user to enter text and provides multiline editing.")]
[Designer(DesignerBaseTypeName="System.ComponentModel.Design.IDesigner", DesignerTypeName="GrapeCity.Win.MultiRow.Design.DataFieldAndValidatorCellDesigner,GrapeCity.Win.MultiRow.Design, Version=7.20.20141.0, Culture=neutral, PublicKeyToken=0f7a722ee3c2bdd9")]
public class TextBoxCell : Cell 
Remarks

The TextBoxCell class is a special type of Cell used to display a single string of editable text-based information. The currently selected TextBoxCell hosts a TextBoxEditingControl control in which the user can edit the cell's value (assuming the Cell.ReadOnly property of the TextBoxCell is set to false).

Notes to Inheritors: When you derive from TextBoxCell and add new properties to the derived class, be sure to override the Clone method to copy the new properties during cloning operations. You should also call the base class's Clone method so that the properties of the base class are copied to the new cell.

Example
The following code example shows some important TextBoxCell properties. If the cell cannot display the text completely, an ellipsis string "..." is displayed. When you enter edit mode, the text is selected because the HighlightText property is true. If you delete the original text and input some text, only 10 characters are allowed because the MaxLength is 10.
using System;
using System.Windows.Forms;
using System.Drawing;

namespace GrapeCity.Win.MultiRow.SampleCode
{
    public class TextBoxCellDemo : Form
    {
        private GcMultiRow gcMultiRow1 = new GcMultiRow();

        [STAThreadAttribute()]
        public static void Main()
        {
            Application.EnableVisualStyles();
            Application.Run(new TextBoxCellDemo());
        }

        public TextBoxCellDemo()
        {
            this.gcMultiRow1.Dock = DockStyle.Fill;
            this.Text = "TextBoxCell Demo";
            this.Controls.Add(this.gcMultiRow1);
            this.Load += new EventHandler(Form1_Load);

            this.Size = new Size(400, 350);
        }
        
        private void Form1_Load(object sender, EventArgs e)
        {
            TextBoxCell textBoxCell1 = new TextBoxCell();
            //If the text cannot display completely, a '......' string is shown at the end, hover over the cell, the whole 
text is shown in a tooltip.
            textBoxCell1.Ellipsis = MultiRowEllipsisMode.EllipsisEnd;
            textBoxCell1.EllipsisString = "......";
            //Enter the edit mode, the text is selected.
            textBoxCell1.HighlightText = true;
            textBoxCell1.Value = "DELETE THIS STRING TO INPUT, ONLY 10 CHARACTERS ALLOWED";
            textBoxCell1.MaxLength = 10;
            //The value is cast to lower case.
            textBoxCell1.CharacterCasing = CharacterCasing.Lower;

            TextBoxCell textBoxCell2 = new TextBoxCell();
            //Input text in textBoxCell2, it is treated as a password, always displays '#'.
            textBoxCell2.PasswordChar = '#';
            textBoxCell2.UseSystemPasswordChar = false;
            textBoxCell2.Value = "12345";

            Template template1 = Template.CreateGridTemplate(new Cell[] { textBoxCell1, textBoxCell2 }, 160,
                AutoGenerateGridTemplateStyles.ColumnHeader | 
AutoGenerateGridTemplateStyles.RowHeaderAutoNumber);

            gcMultiRow1.Template = template1;
            gcMultiRow1.RowCount = 3;
        }
Imports System
Imports System.Windows.Forms
Imports System.Drawing
Imports GrapeCity.Win.MultiRow

Public Class TextBoxCellDemo
    Inherits Form
    Private gcMultiRow1 As New GcMultiRow()

    Public Sub New()
        Me.gcMultiRow1.Dock = DockStyle.Fill
        Me.Text = "TextBoxCell Demo"
        Me.Controls.Add(Me.gcMultiRow1)

        Me.Size = New Size(400, 350)
    End Sub

    Private Sub Form1_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load
        Dim textBoxCell1 As New TextBoxCell()
        'If the text cannot display completely, a '......' string is shown at the end, hover over the cell, the whole text 
is shown in a tooltip.
        textBoxCell1.Ellipsis = MultiRowEllipsisMode.EllipsisEnd
        textBoxCell1.EllipsisString = "......"
        'Enter edit mode, the text is selected.
        textBoxCell1.HighlightText = True
        textBoxCell1.Value = "DELETE THIS STRING TO INPUT, ONLY 10 CHARACTERS ALLOWED"
        textBoxCell1.MaxLength = 10
        'The value is cast to lower case.
        textBoxCell1.CharacterCasing = CharacterCasing.Lower

        Dim textBoxCell2 As New TextBoxCell()
        'Input text in textBoxCell2, it is treated as a password, always displays '#'.
        textBoxCell2.PasswordChar = "#"c
        textBoxCell2.UseSystemPasswordChar = False
        textBoxCell2.Value = "12345"

        Dim template1 As Template = Template.CreateGridTemplate(New Cell() {textBoxCell1, textBoxCell2})

        gcMultiRow1.Template = template1
        gcMultiRow1.RowCount = 3
    End Sub
Inheritance Hierarchy

System.Object
   System.MarshalByRefObject
      System.ComponentModel.Component
         GrapeCity.Win.MultiRow.Cell
            GrapeCity.Win.MultiRow.TextBoxCell
               GrapeCity.Win.MultiRow.FilteringTextBoxCell

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

TextBoxCell Members
GrapeCity.Win.MultiRow Namespace
Cell Class
TextBoxEditingControl Class

 

 


Copyright © GrapeCity, inc. All rights reserved.