GrapeCity MultiRow Windows Forms Documentation
Ellipsis Property (TextBoxCell)
Example 


Gets or sets how to show an ellipsis when the width of the display text is greater than the cell content area.
Syntax
<EditorBrowsableAttribute()>
<DefaultValueAttribute()>
<BrowsableAttribute(True)>
<SRCategoryAttribute("Behavior")>
<SRDescriptionAttribute("Indicates how to show an ellipsis when the width of the display text is greater than the cell's content area width.")>
Public Property Ellipsis As MultiRowEllipsisMode
Dim instance As TextBoxCell
Dim value As MultiRowEllipsisMode
 
instance.Ellipsis = value
 
value = instance.Ellipsis
[EditorBrowsable()]
[DefaultValue()]
[Browsable(true)]
[SRCategory("Behavior")]
[SRDescription("Indicates how to show an ellipsis when the width of the display text is greater than the cell's content area width.")]
public MultiRowEllipsisMode Ellipsis {get; set;}

Property Value

One of the MultiRowEllipsisMode values. The default is MultiRowEllipsisMode.None.
Exceptions
ExceptionDescription
System.ComponentModel.InvalidEnumArgumentExceptionThe specified value is not a MultiRowEllipsisMode value.
Remarks

Use this property with the EllipsisString property.

When some cell styles are used, such as CellStyle.Multiline, CellStyle.TextAngle, CellStyle.TextAdjustment, or CellStyle.LineAdjustment, the ellipsis string cannot be displayed.
Example
The following code example shows some important TextBoxCell properties. The cell cannot display the text completely so 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. The upper case text is converted to lower case. This example is part of a larger example available for the TextBoxCell class.
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;
        }
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
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 Class
TextBoxCell Members
EllipsisString Property

 

 


Copyright © GrapeCity, inc. All rights reserved.