FolderNameEditor

2 posts, 0 answers
  1. Jason Parrish
    Jason Parrish avatar
    91 posts
    Member since:
    Sep 2009

    Posted 12 Apr Link to this post

    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

     

  2. Dess
    Admin
    Dess avatar
    2110 posts

    Posted 13 Apr Link to this post

    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.
Back to Top