Ejemplo n.º 1
0
        /// <summary>
        /// Attaches referenced column combobox to the proper datasource with posible
        /// referenced columns.
        /// </summary>
        private void AttachReferencedColumnColumn()
        {
            if (!String.IsNullOrEmpty(ReferencedTable))
            {
                // Reset data soure before rebind
                referenceColumn.DataSource = null;

                // Restore binding settings
                referenceColumn.DataPropertyName = ForeignKeyColumn.ReferencedColumn;
                referenceColumn.DisplayMember    = Column.Name;
                referenceColumn.ValueMember      = Column.Name;

                // Set data source for referenced column column
                referenceColumn.DataSource = ColumnDescriptor.Enumerate(
                    Connection,
                    new object[] {
                    null,
                    Connection.Schema,
                    ReferencedTable
                });
            }
            else
            {
                // Reset data source for referenced column column
                referenceColumn.DataSource = null;
            }
        }