Ejemplo n.º 1
0
        /// <summary>
        /// Initializes the designer with the specified component.
        /// </summary>
        /// <param name="component">The IComponent to associate the designer with.</param>
        public override void Initialize(IComponent component)
        {
            // Let base class do standard stuff
            base.Initialize(component);

            // Cast to correct type
            _comboBox = component as KryptonDataGridViewComboBoxColumn;

            // Get access to the design services
            _changeService = (IComponentChangeService)GetService(typeof(IComponentChangeService));
        }
        /// <summary>
        /// Create a cloned copy of the column.
        /// </summary>
        /// <returns></returns>
        public override object Clone()
        {
            KryptonDataGridViewComboBoxColumn cloned = base.Clone() as KryptonDataGridViewComboBoxColumn;

            cloned.Items.AddRange(Items);

            // Convert collection of strings to an array
            string[] strings = new string[AutoCompleteCustomSource.Count];
            for (int i = 0; i < strings.Length; i++)
            {
                strings[i] = AutoCompleteCustomSource[i];
            }

            cloned.AutoCompleteCustomSource.AddRange(strings);


            // Move the button specs over to the new clone
            foreach (ButtonSpec bs in ButtonSpecs)
            {
                cloned.ButtonSpecs.Add(bs.Clone());
            }

            return(cloned);
        }