Search code examples
c#wpfxamltelerik

WPF - modify RadFilePathPicker properties when used as a RadPropertyGrid Editor Attribute


I have a RadFilePathPicker as a RadPropertyGrid editor attribute

The RadFilePathPicker is defined as a property attribute as follow:

[Telerik.Windows.Controls.Data.PropertyGrid.Editor(typeof(RadFilePathPicker), "FilePath")]
public string HtmlSourceFile { get; set; }

I would like to set the RadFilePathPicker ReadOnly property to false (default is true), however, the RadFilePathPicker is created from the RadPropertyGrid control and thus have no access to modify its properties.

Is there a way to modify the RadFilePathPicker properties ? perhaps by settings a xaml template for the whole window?


Solution

  • I don't think that there is a built in option for that. Either add an implicit style targeting RadFilePathPicker and set IsReadOnly to false, or subscribe to the FieldLoaded event of RadPropertyGrid and set (Field.Content as RadFilePathPicker).IsReadOnly to false.