in

C1 Community

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

C1Combo and Columns order

Last post 05-19-2008 2:10 AM by C1_JohnAd. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 05-14-2008 3:38 AM

    C1Combo and Columns order

    I use a C1Combo with a collection of objects as datasource (at run time). The C1Combobo seems to creates one column by public property.

    I have to hide some columns I don't want to have in my combo but how can I change (or set) the column order ?

    Thanks in advance for help.
    François.

  • 05-15-2008 9:04 AM In reply to

    Re: C1Combo and Columns order

    Hi,

    You can hide the columns using the DisplayColumn collection of C1Combo.
    Below is the code snippet for the same:

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
    System.EventArgs) Handles Button1.Click

    Me.C1Combo1.Splits(0).DisplayColumns(colIndex or ColumnName).Visible = False

    End Sub

    Hope this helps.

    Regards,
    John Adams


    wrote in message news:204840@10.0.1.98...
    I use a C1Combo with a collection of objects as datasource (at run time).
    The C1Combobo seems to creates one column by public property.
    I have to hide some columns I don't want to have in my combo but how can I
    change (or set) the column order ?
    Thanks in advance for help.
    François.



    http://helpcentral.componentone.com/cs/forums/p/75238/204840.aspx#204840
  • 05-15-2008 11:36 AM In reply to

    Re: C1Combo and Columns order

    It is OK for hide, but now I want to reorder the displayed columns? How can I do that or have you an explanation of how C1Combo creates the columns when it is linked to an object?

    Thanks in advance.
    François.

  • 05-19-2008 2:10 AM In reply to

    Re: C1Combo and Columns order

    Hi,
     
    There is no direct way of changing the order of columns. However, you may try the following code snippet:
     
    BEGIN CODE
     

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click

    Dim ColIndex As Integer

    'Storing index of the column to be moved

    ColIndex = Me.C1Combo1.Splits(0).DisplayColumns.IndexOf(Me.C1Combo1.Splits(0).DisplayColumns("OrderID"))

    ' Inserting the column at desired place in the C1Combo

    Me.C1Combo1.Splits(0).DisplayColumns.Insert(4, Me.C1Combo1.Splits(0).DisplayColumns(ColIndex))

    ' Removing the column from its old location

    Me.C1Combo1.Splits(0).DisplayColumns.RemoveAt(Me.C1Combo1.Splits(0).DisplayColumns.IndexOf(Me.C1Combo1.Splits(0).DisplayColumns(ColIndex)))

    End Sub

     
    END CODE
     
    Hope this helps.
     
    Regards,
    John Adams
     
    <fdrouhin> wrote in message news:204890@10.0.1.98...

    It is OK for hide, but now I want to reorder the displayed columns? How can I do that or have you an explanation of how C1Combo creates the columns when it is linked to an object?

    Thanks in advance.
    François.



    http://helpcentral.componentone.com/cs/forums/p/75238/204890.aspx#204890

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