This is a migrated thread and some comments may be shown as answers.

mouse scrol combobox gridview

0 Answers 9 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Вадим
Top achievements
Rank 1
Iron
Вадим asked on 01 Apr 2018, 04:36 PM

At you on a forum found an example how to make grouping in a combo which is in date grid.
Applying this method a couple of questions arose.
1) Mouse scrolling does not work.
2) How to make AutoCompleteMode

private void UpdateComboBoxSpeziolist()
        {
            var commandServer = new CommandServer();
 
            _radSpeziolist.SelectedItemChanged += new EventHandler(lv_SelectedItemChanged);
            _radSpeziolist.DisplayMember = "fio";
            _radSpeziolist.ValueMember = "fio";
            _radSpeziolist.DataSource = commandServer.GetDataGridSet(@"select *
                from spezialistSurvey()").Tables[0];
            _radSpeziolist.EnableGrouping = true;
            _radSpeziolist.ShowGroups = true;
 
            GroupDescriptor group = new GroupDescriptor(new SortDescriptor[] { new SortDescriptor("cat", ListSortDirection.Descending) });
            _radSpeziolist.GroupDescriptors.Add(group);
            _radSpeziolist.AllowEdit = true;
            _radSpeziolist.CollapseAll();           
        }
 
private void radGridView2_CellEditorInitialized(object sender, GridViewCellEventArgs e)
        {
            if(e.ActiveEditor is RadDropDownListEditor)
            {
                RadDropDownListEditor editor = e.ActiveEditor as RadDropDownListEditor;
                RadDropDownListEditorElement element = editor.EditorElement as RadDropDownListEditorElement;
                element.DropDownSizingMode = SizingMode.UpDownAndRightBottom;
                element.Popup.Controls.Add(_radSpeziolist);
                element.DropDownMinSize = new Size(300, 300);
                element.PopupOpening += new CancelEventHandler(element_PopupOpening);
            }
        }
 
void element_PopupOpening(object sender, CancelEventArgs e)
        {
            _radSpeziolist.Size = ((RadDropDownListEditorElement)sender).Popup.Size;
            _radSpeziolist.AutoScroll = true;
 
        }
        private void lv_SelectedItemChanged(object sender, EventArgs e)
        {
            ListViewItemEventArgs args = (ListViewItemEventArgs)e;
            if (args.Item != null && radGridViewSurvey.CurrentCell != null)
            {
                this.radGridViewSurvey.CurrentCell.Value = args.Item.Value;
                ((DropDownPopupForm)args.ListViewElement.ElementTree.Control.Parent).ClosePopup(RadPopupCloseReason.Mouse);
                radGridViewSurvey.CancelEdit();
            }
        }

No answers yet. Maybe you can help?

Tags
GridView
Asked by
Вадим
Top achievements
Rank 1
Iron
Share this question
or