in

C1 Community

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

C1Combo from 1.1 to dotNet 2

Last post 11-08-2007 12:08 PM by C1_GregL. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 10-31-2007 12:50 PM

    C1Combo from 1.1 to dotNet 2

    I have code in visual studio 2003. It works
    public class FAList
    {
        private string _value = "1";
        private string _display = "Best";
        public FAList(string giatri, string display)
        {
            this.Value = giatri;
            this.Display = display;
        }
        public FAList()
        {
            this.Value = "";
            this.Display = "";
        }
        public string Value
        {
            get { return _value; }
            set { _value = value; }
        }
        public string Display
        {
        get { return _display; }
        set { _display = value; }
        }
    }

    private void Form1_Load(object sender, EventArgs e)
    {
        ...
        this.c1Combo1.ComboStyle = C1.Win.C1List.ComboStyleEnum.DropdownList;
        this.c1Combo1.DisplayMember = "Display";
        this.c1Combo1.ValueMember = "Value";
        this.c1Combo1.ColumnHeaders = false;
        FAList[] dataSource = new FAList[2];
        dataSource[0] = new FAList("1", "Best");
        dataSource[1] = new FAList("2", "Good");
        this.c1Combo1.DataSource = dataSource;
        this.c1Combo1.Splits[0].DisplayColumns[1].Visible = false;
        this.c1Combo1.Splits[0].DisplayColumns[0].Width = this.Width;
        this.c1Combo1.SelectedIndex = 0;
        this.c1Combo1.HScrollBar.Style = C1.Win.C1List.ScrollBarStyleEnum.None;
        ...
    }

    But when i convert to visual studio 2005. It doesn't works. I commend 3 line
        //this.c1Combo1.Splits[0].DisplayColumns[1].Visible = false;
        //this.c1Combo1.Splits[0].DisplayColumns[0].Width = this.Width;
        //this.c1Combo1.SelectedIndex = 0;
    It can run but does't work correctly.
    How to use it in VS2005?
    Please help me. Sorry for my english.

    --
    ITG Viet Nam
    www.itgvietnam.com
    hatuan@itgvietnam.com
     

    Filed under:
  • 11-08-2007 12:08 PM In reply to

    • C1_GregL
    • Top 10 Contributor
    • Joined on 06-11-2007
    • Pittsburgh PA
    • Posts 516

    Re: C1Combo from 1.1 to dotNet 2

    Hi,

    This should work so it must be a bug.  It's been escalated to our developers, and I will update you here when it's fixed.

    In the mean time you can use the AddItem mode to add data, especially easy for a small grid like the sample

     Me.C1Combo1.DataMode = DataModeEnum.AddItem
    C1Combo1.AddItemTitles(
    "Value;Display")
    For i As Integer = 0 To 1
         C1Combo1.AddItem(dataSource(i).Value &
    ";" & dataSource(i).Display)
    Next

    regards,
    Greg L

    Issue ID: VNLST000646

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