views:

66

answers:

1

I have a project in my VS 2008 solution containing file items. Each item have a standard read only property called "FullPath" in the Properties Grid.

What is the easiest way to make the FullPath property of the Properties Grid editable?

+1  A: 
  1. Add reference to System.Design

  2. Create class

    public class DllFileNameEditor :
    System.Windows.Forms.Design.FileNameEditor   {         protected override void InitializeDialog(OpenFileDialog openFileDialog)
    {
        base.InitializeDialog(openFileDialog);
        openFileDialog.Filter = "Class Library Files (*.dll) |*.dll|All (*.*) |*.*";
        openFileDialog.Title = "Select Class Library File";
    } }
    
  3. Modify property

    [Category("Identity")]
    [Description("Dll Location")]
    [EditorAttribute(typeof(DllFileNameEditor), typeof(System.Drawing.Design.UITypeEditor))]
    public string DllName
    {
        get { return this.GraphDoc.DllName; }
        set { this.GraphDoc.DllName = value; }
    }
    

mgznet.com/EditFullPathProperty.aspx

GenZiy