Ejemplo n.º 1
0
        public static void BindComboBoxCellDataSource(DataGridViewComboBoxEditingControl control, string[][] dataSource)
        {
            if (dataSource == null ||
                dataSource.Length.Equals(0))
            {
                return;
            }

            List <DataSourceNode> dataSourceNodeList = BindArrayDataHelper.GetDataSource(dataSource, 0, 1);

            control.DataSource    = dataSourceNodeList;
            control.DisplayMember = "Text";
            control.ValueMember   = "Value";
        }
Ejemplo n.º 2
0
        public static void BindComboBoxCellDataSource(DataGridViewComboBoxColumn column, string[][] dataSource)
        {
            if (dataSource == null ||
                dataSource.Length.Equals(0))
            {
                return;
            }

            List <DataSourceNode> dataSourceNodeList = BindArrayDataHelper.GetDataSource(dataSource, 0, 1);

            column.DataSource    = dataSourceNodeList;
            column.DisplayMember = "Text";
            column.ValueMember   = "Value";
            column.SortMode      = DataGridViewColumnSortMode.Programmatic;
        }