예제 #1
0
        /// ------------------------------------------------------------------------------------
        protected virtual void InitializeGrid(IMultiListDataProvider autoCompleteProvider,
                                              FieldGatherer fieldGatherer)
        {
            _gridViewModel = new FieldsValuesGridViewModel(_file, autoCompleteProvider,
                                                           fieldGatherer, key => key != "notes");

            _grid      = new FieldsValuesGrid(_gridViewModel, "BasicFieldGridEditor._grid");
            _grid.Dock = DockStyle.Fill;
            Controls.Add(_grid);
        }
예제 #2
0
        /// ------------------------------------------------------------------------------------
        protected virtual void InitializeGrid(AutoCompleteValueGatherer autoCompleteProvider,
                                              FieldGatherer fieldGatherer)
        {
            _gridViewModel = new FieldsValuesGridViewModel(_file, autoCompleteProvider,
                                                           fieldGatherer, key => !"notes contributions".Contains(key));

            _grid      = new FieldsValuesGrid(_gridViewModel, "MediaComponentEditor._grid");
            _grid.Dock = DockStyle.Fill;
            _tableLayout.Controls.Add(_grid, 0, 1);
            _grid.BringToFront();
        }
예제 #3
0
        /// ------------------------------------------------------------------------------------
        private void InitializeGrid(IMultiListDataProvider autoCompleteProvider, FieldGatherer fieldGatherer)
        {
            _gridViewModel = new CustomFieldsValuesGridViewModel(_file, autoCompleteProvider,
                                                                 fieldGatherer);

            _gridCustomFields = new FieldsValuesGrid(_gridViewModel, "PersonBasicEditor._gridCustomFields")
            {
                Dock = DockStyle.Top
            };
            _panelGrid.AutoSize = true;
            _panelGrid.Controls.Add(_gridCustomFields);
        }
예제 #4
0
        /// ------------------------------------------------------------------------------------
        private void InitializeGrid(IMultiListDataProvider autoCompleteProvider,
                                    FieldGatherer fieldGatherer)
        {
            // additional fields grid
            _additionalFieldsGridViewModel = new AdditionalFieldsValuesGridViewModel(_file, autoCompleteProvider,
                                                                                     fieldGatherer)
            {
                AllowUserToAddRows = false
            };

            _gridAdditionalFields = new FieldsValuesGrid(_additionalFieldsGridViewModel, "SessionBasicEditor._gridAdditionalFields")
            {
                Dock = DockStyle.Top
            };

            // to get a more helpful exception output than the default DataGrid error message
            _gridAdditionalFields.DataError += _gridAdditionalFields_DataError;

            _panelAdditionalGrid.AutoSize = true;
            _panelAdditionalGrid.Controls.Add(_gridAdditionalFields);

            for (int i = 0; i < _gridAdditionalFields.RowCount; i++)
            {
                var listType = _additionalFieldsGridViewModel.GetListType(i);
                if (listType != null)
                {
                    AddDropdownCell(listType, i);
                }
            }

            _gridAdditionalFields.EditingControlShowing += _gridAdditionalFields_EditingControlShowing;
            // custom fields grid
            _gridViewModel = new CustomFieldsValuesGridViewModel(_file, autoCompleteProvider,
                                                                 fieldGatherer);

            _gridCustomFields = new FieldsValuesGrid(_gridViewModel, "SessionBasicEditor._gridCustomFields")
            {
                Dock = DockStyle.Top
            };
            _panelGrid.AutoSize = true;
            _panelGrid.Controls.Add(_gridCustomFields);
        }