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

FolderNameEditor

1 Answer 108 Views
PropertyGrid
This is a migrated thread and some comments may be shown as answers.
Jason Parrish
Top achievements
Rank 1
Jason Parrish asked on 12 Apr 2017, 08:30 PM

Does the Telerik PropertyGrid control not support the FolderNameEditor?  The control is showing a textbox and not the ellipsis button that displays a dialog.

 

<DisplayName("File Archive"), Editor(GetType(FolderNameEditor), GetType(UITypeEditor))>
Property ArchiveLocation As String

 

1 Answer, 1 is accepted

Sort by
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 13 Apr 2017, 09:58 AM
Hello Jason, 

Thank you for writing.  

By default, for string values PropertyGridTextBoxEditor is activated. However, if you need to select a folder, it is suitable to use the PropertyGridBrowseEditor. Here is a sample code snippet demonstrating how to handle the EditorRequired and replace the default editor: 
public RadForm1()
{
    InitializeComponent();
 
    PropertyStoreItem intItem = new PropertyStoreItem(typeof(int), "Integer", 1);
    PropertyStoreItem stringItem = new PropertyStoreItem(typeof(string), "FolderName", @"D:\Projects");
    RadPropertyStore store = new RadPropertyStore();
    store.Add(intItem);
    store.Add(stringItem);
    this.radPropertyGrid1.SelectedObject = store;
 
    this.radPropertyGrid1.EditorRequired += radPropertyGrid1_EditorRequired;
}
 
private void radPropertyGrid1_EditorRequired(object sender, PropertyGridEditorRequiredEventArgs e)
{
    if (e.Item.Label == "FolderName")
    {
        PropertyGridBrowseEditor editor = new PropertyGridBrowseEditor();
        RadBrowseEditorElement el = editor.EditorElement as RadBrowseEditorElement;
        el.DialogType = BrowseEditorDialogType.FolderBrowseDialog;
        e.Editor = editor;
    }
}

I hope this information helps. Should you have further questions I would be glad to help.

Regards,
Dess
Telerik by Progress
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
PropertyGrid
Asked by
Jason Parrish
Top achievements
Rank 1
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
Share this question
or