GrapeCity MultiRow Windows Forms Documentation
ReadOnly Property (Section)
Example 


Gets or sets a value that indicates whether the Section is read-only.
Syntax
<GcSerializationInternalImplAttribute(UseShadowProperty=True, 
   ShadowPropertyName="ReadOnlyInternal", 
   GetMethodName="", 
   SetMethodName="", 
   DescriptorTypeName="GrapeCity.Framework.Xml.Serialization.ShadowSerializablePropertyDescritpor, GrapeCity.Win.MultiRow, Version=7.20.20141.0, Culture=neutral, PublicKeyToken=0f7a722ee3c2bdd9")>
<SRDescriptionAttribute("Indicates whether the Section cells are read-only.")>
<SRCategoryAttribute("Behavior")>
Public Overridable Property ReadOnly As Boolean
Dim instance As Section
Dim value As Boolean
 
instance.ReadOnly = value
 
value = instance.ReadOnly
[GcSerializationInternalImpl(UseShadowProperty=true, 
   ShadowPropertyName="ReadOnlyInternal", 
   GetMethodName="", 
   SetMethodName="", 
   DescriptorTypeName="GrapeCity.Framework.Xml.Serialization.ShadowSerializablePropertyDescritpor, GrapeCity.Win.MultiRow, Version=7.20.20141.0, Culture=neutral, PublicKeyToken=0f7a722ee3c2bdd9")]
[SRDescription("Indicates whether the Section cells are read-only.")]
[SRCategory("Behavior")]
public virtual bool ReadOnly {get; set;}

Property Value

true if this Section is read-only; otherwise, false. The default is false.
Remarks
If you set this property to true, all the Cells in this Section cannot be edited and the Cell's Cell.ReadOnly property is always true and cannot be changed. If the Section's owner GcMultiRow's ReadOnly property is true, the Section's ReadOnly setting is always true and cannot be changed.
Example
The following code example shows how to make a section that can or cannot be selected. For example, you can make the cell in the header section edited and selected. This code example is part of a larger example provided for the Section class.
void editColumnHeaderFooterButton_Click(object sender, EventArgs e)
        {
            Template template = Template.Default;

            ColumnHeaderSection columnHeaderSection = new ColumnHeaderSection();

            columnHeaderSection.Height = 20;

            TextBoxCell textBoxCell = new TextBoxCell();

            textBoxCell.Size = new Size(template.Width, 20);

            textBoxCell.Value = "The cell in header section, try to edit it";

            columnHeaderSection.Cells.Add(textBoxCell);

            // In default, the cell in the column header section can't be select,
            // If you set column header section's Selectable property to true, the cell can be selected.
            columnHeaderSection.Selectable = true;

            // Event if the column header can be selected, in default, the cell in the column header section can't be edited,
            // If you set column header section's ReadOnly property to false, the cell can be edited.
            columnHeaderSection.ReadOnly = false;

            template.ColumnHeaders.Add(columnHeaderSection);

            // Reload template.
            gcMultiRow1.Template = template;
        }
Private Sub editColumnHeaderFooterButton_Click(ByVal sender As Object, ByVal e As EventArgs) Handles editColumnHeaderFooterButton.Click
        Dim template1 As Template = Template.Default

        Dim columnHeaderSection As New ColumnHeaderSection()

        columnHeaderSection.Height = 20

        Dim textBoxCell As New TextBoxCell()

        textBoxCell.Size = New Size(template1.Width, 20)

        textBoxCell.Value = "The cell in header section, try to edit it"

        columnHeaderSection.Cells.Add(textBoxCell)

        ' In default, the cell in the column header section can't be select,
        ' If you set column header section's Selectable property to true, the cell can be selected.
        columnHeaderSection.Selectable = True

        ' Event if the column header can be selected, in default, the cell in the column header section can't be edited,
        ' If you set column header section's ReadOnly property to false, the cell can be edited.
        columnHeaderSection.ReadOnly = False

        template1.ColumnHeaders.Add(columnHeaderSection)

        ' Reload template.
        gcMultiRow1.Template = template1
    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

Section Class
Section Members

 

 


Copyright © GrapeCity, inc. All rights reserved.