Need to change height

2 Answers 172 Views
DropDownList
Nishant
Top achievements
Rank 1
Nishant asked on 15 Jun 2021, 01:14 PM

Hi,

I need to change the height of popup as shown in attached image file, when the dropdown arrow is clicked and popup is shown along with "Close" button.

I have implemented this control exactly as per CustomDropDownList code mentioned in the link:

https://www.telerik.com/support/kb/winforms/dropdown-checkeddropdown-and-list/details/multi-select-drop-down-list

Please help me with the modification needed. 

I do not want to use AutoSize, as the DataSource of dropdown is huge.

Thanks

Nishant

 

2 Answers, 1 is accepted

Sort by
0
Accepted
Dess | Tech Support Engineer, Principal
Telerik team
answered on 16 Jun 2021, 11:15 AM
Hello, Nishant,  

If you are using RadCheckedDropDownList as an editor in RadGridView, note that you can use the RadGridView.CellEditorInitialized event where you have access to the editor itself and thus you can set the desired settings, e.g. DropDownMinSize
        BindingList<MyPart> columnData;
        BindingList<MyPart> datasource;

        public RadForm1()
        {
            InitializeComponent();
            columnData = new BindingList<MyPart>();
            datasource = new BindingList<MyPart>();

            for (int i = 0; i < 5; i++)
            {
                datasource.Add(new MyPart("Part " + i + ";Part " + (i + 1) + ";"));
            }
            radGridView1.AutoGenerateColumns = false;
            radGridView1.DataSource = datasource;

            GridViewTextBoxColumn checkedDropDownListColumn = new GridViewTextBoxColumn();
            checkedDropDownListColumn.FieldName = "CurrentParts";
            checkedDropDownListColumn.Width = 200;

            this.radGridView1.Columns.Add(checkedDropDownListColumn);

            for (int i = 0; i < 10; i++)
            {
                columnData.Add(new MyPart("Part " + i));
            }

            this.radGridView1.EditorRequired += radGridView1_EditorRequired;

            this.radGridView1.CellEditorInitialized+=radGridView1_CellEditorInitialized;
        }

        private void radGridView1_CellEditorInitialized(object sender, GridViewCellEventArgs e)
        {
            RadCheckedDropDownListElement editor = e.ActiveEditor as RadCheckedDropDownListElement;
            if (editor !=null)
            {
                editor.DropDownMinSize = new Size(500, 400);
            }
        }
        
        void radGridView1_EditorRequired(object sender, EditorRequiredEventArgs e)
        {
            if (this.radGridView1.CurrentColumn.Index == 0)
            {
                RadCheckedDropDownListElement editor = new GridViewCheckedDropDownListEditor();
                editor.DataSource = this.columnData;
                editor.DisplayMember = "CurrentParts";
                e.Editor = editor;
            }
        }

        public class GridViewCheckedDropDownListEditor : RadCheckedDropDownListElement
        {
            public override object Value
            {
                get
                {
                    return this.Text;
                }
                set
                {
                    this.Text = value.ToString();
                }
            }
        }

        public class MyPart
        {
            public string CurrentParts { get; set; }
            public MyPart(string currentParts)
            {
                this.CurrentParts = currentParts;
            }
        }

Should you have further questions please let me know.

Regards,
Dess | Tech Support Engineer, Principal
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Nishant
Top achievements
Rank 1
commented on 16 Jun 2021, 12:11 PM

Thanks for helping me out. It worked as I wanted.
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 15 Jun 2021, 01:45 PM

Hi, Nishant,

I would like to note that this is quite an old KB article.

Telerik UI for WinForms suite offers RadCheckedDropDownList which combines RadDropDownList and RadAutoCompleteBox in order to provide functionality to check items in the drop down area and tokenize them in the text area. All previous functionality is preserved, such as visual formatting and data binding, which is now extended.

You can have a look at the following article in order to get started with this control: https://docs.telerik.com/devtools/winforms/controls/dropdown-listcontrol-and-checkeddropdownlist/checkeddropdownlist/getting-started 

The DropDownMinSize property allows you to enlarge the drop down when the arrow button is clicked.

I hope this information helps. If you need any further assistance please don't hesitate to contact me. 

Regards,
Dess | Tech Support Engineer, Principal
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Nishant
Top achievements
Rank 1
commented on 15 Jun 2021, 03:37 PM

Thanks for providing new link. I am using this feature inside RadGridView using link: "https://docs.telerik.com/devtools/winforms/controls/dropdown-listcontrol-and-checkeddropdownlist/checkeddropdownlist/how-to/use-as-radgridview-editor"
How do I set DropDownMinSize property? Please share the code or an example. Thanks.
Tags
DropDownList
Asked by
Nishant
Top achievements
Rank 1
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
Share this question
or