mouse scrol combobox gridview

1 posts, 0 answers
  1. Вадим
    Вадим avatar
    21 posts
    Member since:
    Mar 2016

    Posted 01 Apr 2018 Link to this post

    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();
                }
            }
Back to Top