in

C1 Community

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

C1Combo with object as datasource : how to select columns to display?

Last post 05-13-2008 2:31 AM by fdrouhin. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 05-12-2008 11:14 AM

    C1Combo with object as datasource : how to select columns to display?

    Hello,

    I want to use a collection of objects as a datasource of my C1Combo control. It works fine but a column is created for each public property of my object (10 for my object). How can I display only 2 columns in my control?

    Remark: I have tried the AddItem method but this method is slow when the number of item is important. The DataSource method has very good answer time.

    Thanks in advance for your help

    François.

  • 05-12-2008 5:30 PM In reply to

    Re: C1Combo with object as datasource : how to select columns to display?

    Hello,
     
    You will need to specifically set the visibility of each column.
     
    for example:
     
    BEGIN CODE
     

    For i As Integer = 0 To Me.C1Combo1.Columns.Count - 1

    If Not Me.C1Combo1.Columns(i).Caption = "X" Then

    Me.C1Combo1.Splits(0).DisplayColumns(i).Visible = False

    End If

    Next

    END CODE

    This code will hide all the columns except for the column whose caption is "X".

    I hope this will help.


    Regards,

    Allen Smith

    <fdrouhin> wrote in message news:204769@10.0.1.98...

    Hello,

    I want to use a collection of objects as a datasource of my C1Combo control. It works fine but a column is created for each public property of my object (10 for my object). How can I display only 2 columns in my control?

    Remark: I have tried the AddItem method but this method is slow when the number of item is important. The DataSource method has very good answer time.

    Thanks in advance for your help

    François.



    http://helpcentral.componentone.com/cs/forums/p/75220/204769.aspx#204769

  • 05-13-2008 2:31 AM In reply to

    Re: C1Combo with object as datasource : how to select columns to display?

    Thanks it works.

    Another solution is to remove columns instead of hide columns. What is the better solution for answer time? Hide or Remove?

    Two another questions:

    - how can I retreive the object associated to one item, like the SelectedItem method of the framework ComboBox class? The SelectedValue method seems to return only one value from one method of the object.

    - how can I order the column? I don't really understand the logical of the column creation order.

    Thanks very much.
    Francois.

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