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

editable dropdown control

3 Answers 566 Views
PropertyGrid
This is a migrated thread and some comments may be shown as answers.
adnan
Top achievements
Rank 1
adnan asked on 18 Jan 2019, 12:08 PM
how to achieve editable dropdownlist . i m using TypeConverter. code sample please 

3 Answers, 1 is accepted

Sort by
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 22 Jan 2019, 09:47 AM
Hello, Muhammad,      
  
If I understand your requirement correctly, you need to allow editing the text in the PropertyGridDropDownListEditor. For this purpose, it is necessary to handle the EditorInitialized event and set the DropDownStyle property to DropDown

private void radPropertyGrid1_EditorInitialized(object sender, PropertyGridItemEditorInitializedEventArgs e)
{
    PropertyGridDropDownListEditor editor = e.Editor as PropertyGridDropDownListEditor;
    if (editor != null)
    {
        BaseDropDownListEditorElement element = editor.EditorElement as BaseDropDownListEditorElement;
        element.DropDownStyle = Telerik.WinControls.RadDropDownStyle.DropDown;
    }
}
  
If it is not the exact requirement, please specify in details what is the exact requirement that you are trying to achieve. Thus, we would be able to get better understanding of the precise case and think about a suitable solution.

I hope this information helps. 

Regards,
Dess | Tech Support Engineer, Sr.
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Steve
Top achievements
Rank 1
Veteran
answered on 20 Mar 2020, 03:03 AM
i have set the dropdown . but the input value don't take effect. do you know why?
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 20 Mar 2020, 11:03 AM

Hello, Steve,

Note that the PropertyGridDropDownListEditor accepts only valid values considering the items available in the applied DataSource to the editor. 

According to the provided gif file it seems that you type in the editable area "D" and "E" which don't exist in the DataSource collection. That is why they are not kept. If you type "C" for example, it is expected to be stored in the property item. 

However, if your requirement is to allow the end-users to enter free input, it has to be added to the DataSource as a valid item. The following help article demonstrates a sample approach for the drop down editor in RadGridView. In a similar way, this custom behavior can be achieved for RadPropertyGrid as well: https://docs.telerik.com/devtools/winforms/controls/gridview/editors/how-to/allow-end-users-to-add-items-to-dropdownlisteditor 

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

Regards,
Dess | Tech Support Engineer, Sr.
Progress Telerik

Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
PropertyGrid
Asked by
adnan
Top achievements
Rank 1
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
Steve
Top achievements
Rank 1
Veteran
Share this question
or