GrapeCity MultiRow Windows Forms Documentation
SplitMode Property
Example 


Gets or sets a value that indicates how the GcMultiRow control can be split.
Syntax
<SRDescriptionAttribute("Indicates the mode that determines how the GcMultiRow control is split.")>
<DefaultValueAttribute()>
<FeatureAttribute(Name="Split", Version="v5.0")>
<SRCategoryAttribute("Behavior")>
Public Property SplitMode As SplitMode
Dim instance As GcMultiRow
Dim value As SplitMode
 
instance.SplitMode = value
 
value = instance.SplitMode
[SRDescription("Indicates the mode that determines how the GcMultiRow control is split.")]
[DefaultValue()]
[Feature(Name="Split", Version="v5.0")]
[SRCategory("Behavior")]
public SplitMode SplitMode {get; set;}

Property Value

One of the SplitMode values that indicates how the GcMultiRow control can be split. The default is SplitMode.Both.
Exceptions
ExceptionDescription
System.ComponentModel.InvalidEnumArgumentExceptionThe specified value is not one of the SplitMode values.
Remarks
You can view the GcMultiRow control in many viewports by dragging a split line at the horizontal scrollbar or vertical scrollbar's head.
Example
The following code example shows how to use the split feature. You can disable or enable the UI split, add or remove viewports with code, or customize the split line's appearance.
public class SplitDemo : Form
  {
      private GcMultiRow gcMultiRow1 = new GcMultiRow();
      private FlowLayoutPanel panel = new FlowLayoutPanel();

      public SplitDemo()
      {
          this.Text = "Multi-Viewports Demo";
          this.Size = new Size(570, 350);

          // Initial flow layout panel and add to form.
          this.panel.Dock = DockStyle.Left;
          this.panel.Size = new Size(300, 200);
          this.panel.FlowDirection = FlowDirection.TopDown;
          this.panel.WrapContents = false;
          this.panel.Padding = new Padding(5);
          this.Controls.Add(panel);

          // Add MultiRow to form
          this.gcMultiRow1.Dock = DockStyle.Left;
          this.gcMultiRow1.Width = 300;
          this.Controls.Add(this.gcMultiRow1);

          // Tip label
          Label label = new Label();
          label.Height = 20;
          label.Dock = DockStyle.Bottom;
          label.BackColor = SystemColors.Info;
          label.Text = "Yow can try to click buttons or drag split line or drag split button to create or remove viewports.";
          this.Controls.Add(label);

          this.Load += new EventHandler(Form1_Load);

          InitButton();
      }

      private void Form1_Load(object sender, EventArgs e)
      {
          gcMultiRow1.Template = Template.CreateGridTemplate(10);
          gcMultiRow1.RowCount = 30;

          // Initialize cell value for MultiRow control.
          for (int i = 0; i < gcMultiRow1.RowCount; i++)
          {
              gcMultiRow1.SetValue(i, "textBoxCell1", i);
          }
      }

void setSplitModeButton_Click(object sender, EventArgs e)
      {
          if (this.gcMultiRow1.SplitMode == SplitMode.Both)
          {
              // Disable UI split.
              this.gcMultiRow1.SplitMode = SplitMode.None;
          }
          else
          {
              // Enable UI split.
              this.gcMultiRow1.SplitMode = SplitMode.Both;
          }
      }
Public Class SplitDemo
    Inherits Form
    Private gcMultiRow1 As New GcMultiRow()
    Private panel As New FlowLayoutPanel()

    Public Sub New()
        Me.Text = "Multi-Viewports Demo"
        Me.Size = New Size(570, 350)

        ' Initial flow layout panel and add to form.
        Me.panel.Dock = DockStyle.Left
        Me.panel.Size = New Size(300, 200)
        Me.panel.FlowDirection = FlowDirection.TopDown
        Me.panel.WrapContents = False
        Me.panel.Padding = New Padding(5)
        Me.Controls.Add(panel)

        ' Add MultiRow to form
        Me.gcMultiRow1.Dock = DockStyle.Left
        Me.gcMultiRow1.Width = 300
        Me.Controls.Add(Me.gcMultiRow1)

        ' Tip label
        Dim label As New Label()
        label.Height = 20
        label.Dock = DockStyle.Bottom
        label.BackColor = SystemColors.Info
        label.Text = "Yow can try to click buttons or drag split line or drag split button to create or remove viewports."
        Me.Controls.Add(label)
        InitButton()
    End Sub

    Private Sub Form1_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load
        gcMultiRow1.Template = Template.CreateGridTemplate(10)
        gcMultiRow1.RowCount = 30

        ' Initialize cell value for MultiRow control.
        For i As Integer = 0 To gcMultiRow1.RowCount - 1
            gcMultiRow1.SetValue(i, "textBoxCell1", i)
        Next
    End Sub
	Private Sub setSplitModeButton_Click(ByVal sender As Object, ByVal e As EventArgs) Handles setSplitModeButton.Click
        If Me.gcMultiRow1.SplitMode = SplitMode.Both Then
            ' Disable UI split.
            Me.gcMultiRow1.SplitMode = SplitMode.None
        Else
            ' Enable UI split.
            Me.gcMultiRow1.SplitMode = SplitMode.Both
        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

GcMultiRow Class
GcMultiRow Members
SplitStyle Property
SplitOffice2007Style Property

 

 


Copyright © GrapeCity, inc. All rights reserved.