Model Editor in RadPropertyGrid

2 Answers 42 Views
PropertyGrid
OBollmann
Top achievements
Rank 2
Iron
OBollmann asked on 16 Mar 2023, 09:39 PM | edited on 16 Mar 2023, 09:40 PM

[edit: I meant "Modal" Editor and not "Model" editor in the title but I can't update]

Hi,

 

as I know you can use a custom modal editor with an Editor attribute that is declared on a property. Is it possible to use a modal editor with a programmatic approach with PropertyDefinition? I have a dynamic class where I do not have the possibility to declare attributes on properties. On the PropertyDefinition class there is an EditorTemplate property. I managed to use this. But only "in cell" and not modal. Is that possible?

Best regards,

Oliver

2 Answers, 1 is accepted

Sort by
0
Martin Ivanov
Telerik team
answered on 20 Mar 2023, 06:33 AM

Hello Oliver,

Setting the EditorStyle of the Editor attribute to Modal, will auto-generate a ModalEditor control placed in the content of the property field. You can do this manually by defining the ModalEditor in the EditTemplate of the PropertyDefinition. For example:

<DataTemplate x:Key="ModalEditorTemplate">
	<telerik:ModalEditor>
		<telerik:ModalEditor.Editor>
			<TextBox Text="{Binding MyProperty}"/>
		</telerik:ModalEditor.Editor>
	</telerik:ModalEditor>
</DataTemplate>

Regards,
Martin Ivanov
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

0
OBollmann
Top achievements
Rank 2
Iron
answered on 20 Mar 2023, 07:18 AM

Hi Martin,

 

thank you for your reply. That works well for me! I closed the corresponding case.

 

Thank you very much and best regards,

Oliver

Tags
PropertyGrid
Asked by
OBollmann
Top achievements
Rank 2
Iron
Answers by
Martin Ivanov
Telerik team
OBollmann
Top achievements
Rank 2
Iron
Share this question
or