This seems like it would be a common issue but I have not been able to find a reference in either the documentation or forums. I have a class that I want to edit using the RadPropertyGrid and one of the public properties is a string that contains a file path. I want to use the OpenFileDialog (or equivalent) to edit this property. Any help would be appreciated...
Thanks
Dave Goughnour
6 Answers, 1 is accepted
Please excuse us for the delayed answer. Basically, RadPropertyGrid does not have such default editor, but you can easily customize it. Here is an article that illustrates how to assign your own editors to the fields. I guess that you need some button which displays OpenFIleDialog when gets clicked. Please, do not hesitate to ask for additional assistance in case it is needed.
Regards,Ivan Ivanov
the Telerik team
Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.


<
Grid.Resources
>
<
local:PropertyGridTemplateSelector
x:Key
=
"dataTemplateSelector"
>
<
local:PropertyGridTemplateSelector.FilenamePropertyTemplate
>
<
DataTemplate
>
<
Grid
>
<
Grid.ColumnDefinitions
>
<
ColumnDefinition
/>
<
ColumnDefinition
Width
=
"Auto"
/>
</
Grid.ColumnDefinitions
>
<
TextBox
Text
=
"{Binding FilePath}"
Grid.Column
=
"0"
/>
<
Button
Content
=
"..."
Width
=
"25"
Height
=
"25"
Grid.Column
=
"1"
Click
=
"SelectFileClick"
/>
</
Grid
>
</
DataTemplate
>
</
local:PropertyGridTemplateSelector.FilenamePropertyTemplate
>
<!-- More templates here -->
</
local:PropertyGridTemplateSelector
>
</
Grid.Resources
>
Obviously the SelectFileClick handler displays the OpenFileDialog...


@David, Thank you for posting this sample code.
@Kristoffer, our current policy towards RadPropertyGrid is to make it easily customizable, so that clients can adapt it for their custom needs. We have default editors for the most common types and we implement such for the most popular feature request, but we have never had considerable demand for filename editor. We will consider it for the future releases, in case it gains popularity.
Ivan Ivanov
Telerik
Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.