This is a migrated thread and some comments may be shown as answers.

Saving Modifications...

2 Answers 185 Views
PropertyGrid
This is a migrated thread and some comments may be shown as answers.
Joel
Top achievements
Rank 2
Joel asked on 15 Mar 2012, 07:02 AM
Hi Dear Telerik :)

Maybe this is a dumb question....

In the First Look example when you use a button... is there any way to save this modifications and stored as xml or database field or something and then load this later to affect the behavior of the button maybe in the onLoad event of the main form ?

Also, it's possible to use the PropertyGrid with objects of a parent form? I mean, clicking a button and property grid loaded in a child form affecting properties of some control of the parent form?

And with that ... is there a way to assign controls programmatically to the propertygrid?

Thanx in advance!

:)

2 Answers, 1 is accepted

Sort by
0
Accepted
Ivan Petrov
Telerik team
answered on 16 Mar 2012, 05:02 PM
Hello Mario,

Thank you for writing.

Directly to your questions.
1. There is no built-in functionality to export all settings from the RadPropertyGrid. You will have to implement it on your own. This should not be very difficult as you have access to all the PropertyGridItems, which represent properties of the edited object through the RadPropertyGrid.Items property. You can iterate and save all values to an xml for example. Then you can restore them by reading them form the saved xml and setting then through the same items collection.

2. There is no problem to set an object form a parent, child or any other form to the RadPropertyGrid. You just have to do it through code and not through the designer.

3. To set an object as selected for the RadPropertyGrid using code, you should use the SelectedObject property. You an also set a collection of objects as selected using the SelectedObjects property.

I hope this will be useful for you. Should you have further questions, I would be glad to help.

Kind regards,
Ivan Petrov
the Telerik team
RadControls for WinForms Q1'12 release is now live! Check out what's new or download a free trial >>
0
Abdul
Top achievements
Rank 1
answered on 13 Nov 2017, 08:54 AM

Hi Ivan Petrov,

        I have  a RadForm,in which many RadControls are there (RadTextBox,RadDropDownList,RadMultiColumnComboBox,RadGridView,RadButon,RadDateTimePicker,RadToggleSwitch,RadCheckBox,RadRadioButton,etc).When I closing the Form I need to save all values in controls into an XML file instead of DataBase.Then Load it from XML to controls.How can i handle this?

I hope you got my requirement.

If any clarification,please let me know?

Regards

ABDUL HAFEEL T H

 

 

Tags
PropertyGrid
Asked by
Joel
Top achievements
Rank 2
Answers by
Ivan Petrov
Telerik team
Abdul
Top achievements
Rank 1
Share this question
or