in

C1 Community

ComponentOne Community is a free source for developers and help authors to collaborate and communicate.

Removing all splits in code

Last post 05-06-2008 1:24 AM by C1_JohnAd. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 05-01-2008 2:26 PM

    Removing all splits in code

    How does one go about removing all splits in code? I've tried the following but the program ends up crashing.

    Dim f_i As Integer, f_Count As Integer
    f_Count = (p_GridObj.Splits.Count - 1)
    For f_i = f_Count To 1 Step -1
        p_GridObj.Splits.RemoveAt(f_i)
    Next

    Also, the doc states to use the RemoveVerticalSplit, and RemoveHorizontalSplit method calls, but there is no way (that I can find) how to determine if a split returned from the split collection is a Vertical or Horizontal Split object.

    Michael
     

  • 05-06-2008 1:24 AM In reply to

    Re: Removing all splits in code

    Hello Michael,
     
    We have the option to know the number of Vertical Splits and Horizontal Splits in
    the splits collection. You can try the given code for your requirement.
     
    BEGIN CODE

    Dim i As Integer

    For i = Me.C1TrueDBGrid1.Splits.ColCount - 1 To 1 Step -1

    Me.C1TrueDBGrid1.RemoveHorizontalSplit(i)

    Next

    For i = Me.C1TrueDBGrid1.Splits.RowCount - 1 To 1 Step -1

    Me.C1TrueDBGrid1.RemoveVerticalSplit(i)

    Next

    END CODE

    Last split cannot be removed. I hope this will help.

    Regards,

    Allen Smith

    <VazWare> wrote in message news:204495@10.0.1.98...

    How does one go about removing all splits in code? I've tried the following but the program ends up crashing.

    Dim f_i As Integer, f_Count As Integer
    f_Count = (p_GridObj.Splits.Count - 1)
    For f_i = f_Count To 1 Step -1
        p_GridObj.Splits.RemoveAt(f_i)
    Next

    Also, the doc states to use the RemoveVerticalSplit, and RemoveHorizontalSplit method calls, but there is no way (that I can find) how to determine if a split returned from the split collection is a Vertical or Horizontal Split object.

    Michael
     



    http://helpcentral.componentone.com/cs/forums/p/75133/204495.aspx#204495

Page 1 of 1 (2 items)
Contact ComponentOne: 1.800.858.2739 ©1987-2008 ComponentOne LLC All Rights Reserved.