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

RadPropertyStore-Question

11 Answers 295 Views
PropertyGrid
This is a migrated thread and some comments may be shown as answers.
Michael Storchmann
Top achievements
Rank 1
Michael Storchmann asked on 21 Nov 2011, 12:21 AM

Hi,

the new RadPropertyStore feature looks very promising. I want to build a PropertyGrid without binding to an .NET-Object but to a dynamic collection of Data. The RadPropertyStore is exactly what I need. But I have one Problem: According to Your WinForms PropertyGrid/Property Store-Demo the PropertyGridDropDownListEditor seems only work with enumerations. That is too static. I have e.g. a list of strings ("FrontWheelDrive", "RearWheelDrive", "AllWheelDrive"). The values ara stored in a Database and can differ.

Is it possible to use the PropertyGridDropDownListEditor with a list (or array) of strings or the like?

Michael

11 Answers, 1 is accepted

Sort by
0
Ivan Petrov
Telerik team
answered on 21 Nov 2011, 05:11 PM
Hello Michael,

Thank you for writing.

We created the example using enums to make it with the smallest number of lines of code possible. We wanted to put the focus on the RadPropertyStore and not on modifying editors and validating data. 
On your questions about the editor. This editing system in the RadPropertyGrid was built with the intention to be as flexible as possible. This is why you can choose the editor you use for your data and you can customize this editor. I have attached a sample project where I have demonstrated how to put a custom data source for the drop down editor. There are two properties in the property store, one integer and one string. They are both edited with drop down list editors. The goal here is to demonstrate how to populate the editor with your data and how to edit one data type with another.

I hope this will be useful for you. Should you need further help I would be glad to assist.

Greetings,
Ivan Petrov
the Telerik team

Q2’11 SP1 of RadControls for WinForms is available for download (see what's new); also available is the Q3'11 Roadmap for Telerik Windows Forms controls.

0
Michael Storchmann
Top achievements
Rank 1
answered on 21 Nov 2011, 10:21 PM

Hi Ivan,

thanks for your support. I had a similar Solution (except the EditorInitialized-Part. Your documentation of the PropertyGrid isn´t very extensive. No word about your BuiltIn-Editors, only how to customize one of it) - with the same problem:

The Editor-Customizing depends on the Property-Name - or at least on the Property-Type. That name is displayed in the PropertyGrid. In a multilanguage environment the name can change - even the name can be more than one time stored in the ProperyStore (in another category). It would be very helpful, if the PropertyStoreItem has a unique identificationfield (or a simple Tag-Field), which can accessed by the PropertyGridItemEditorInitializedEventArgs/PropertyGridEditorRequiredEventArgs-Objects. Simple example:

store.Add(new PropertyStoreItem(typeof(string), "CardReaderType", "Legic Advant", "Type of CardReader", "Reader 1", false, "TagOnlyLegic"));

store.Add(new PropertyStoreItem(typeof(string), "CardReaderType", "Mifare DESfire", "Type of CardReader", "Reader 2", false, "TagOnlyMifare"));

The last (not existing) parameter is the unique identifier. Of course, "CardReaderType" can be made unique ("CardReaderType 1", "CardReaderType 2") but in German the name is complete different ("Kartenleser-Typ"). An internal identifier is a better choice.

My goal is to develop one generic configurationtool for all of our products. I am tired of programming it every time :-) I have already written a WPF-Programm with RadGridViews, but it performs not very well and startup-time on 1 Ghz SingleCore machines is slow. I think, WinForms is in that case the better choice. The PropertyStore-Feature comes at the right time.

Michael

0
Ivan Petrov
Telerik team
answered on 24 Nov 2011, 11:20 AM
Hi Michael,

Thank you for writing back.

Improvement of our documentation on RadPropertyGrid is in our plans and we will add more articles in the near future.

Currently, the RadPropertyStore allows adding two properties with the same name, but this is actually an issue and not a feature. The same is not possible with a .NET object as it would not even compile with two properties with the same name. We will address this issue and I have updated your Telerik points for reporting it.

Since the property name should and will be unique you can use it as identifier. Every PropertyGridItem has a property called Label which is usually filled by the DisplayName attribute, but can also be set programmatically. When it is set, the string in it is used instead of the property name. You can use this property to localize your tool. 

We value your feedback very much and I have marked a few improvements we should implement in the RadPropertyStore which would make the work with it easier.

I hope you will find his info useful. If you have other questions do not hesitate to write back.

All the best,
Ivan Petrov
the Telerik team

Q2’11 SP1 of RadControls for WinForms is available for download (see what's new); also available is the Q3'11 Roadmap for Telerik Windows Forms controls.

0
Michael Storchmann
Top achievements
Rank 1
answered on 27 Nov 2011, 10:24 AM

Hi Ivan,

thanks, your recommended Solution works. Simple example:

var store = new RadPropertyStore();
store.Add(new PropertyStoreItem(typeof(string), "UniqueID1", "Test", "TestItemDescr1", "Cat1"));
store.Add(new PropertyStoreItem(typeof(string), "UniqueID2", "Another Test", "TestItemDescr2", "Cat2", false));
this.radPropertyGrid1.SelectedObject = store;
this.radPropertyGrid1.Items["UniqueID1"].Label = "NonUniqueText";
this.radPropertyGrid1.Items["UniqueID2"].Label = "NonUniqueText";

But i found a bug. If i set the PropertySort-Property to "Categorized", your control don´t show the cateogories (Cat1 und Cat2).
Instead it shows the PropertyName (see ProbGrid.png). After typing some text in the Filterbox and after clearing the text, the control shows the right categrories.

Michael

 

0
Accepted
Ivan Petrov
Telerik team
answered on 30 Nov 2011, 12:55 PM
Hi Michael,

Thank you for your reply.

To work around the group name issue you should set the RadPropertyGrid PropertySort property after you have set the SelectedObject. We are aware of this behavior and will try to address it in our upcomming service pack.

I hope this will help you out. If you have other questions or feedback, we would love to hear it.

Kind regards,
Ivan Petrov
the Telerik team

Q3’11 of RadControls for WinForms is available for download (see what's new). Get it today.

0
Michael Storchmann
Top achievements
Rank 1
answered on 30 Nov 2011, 11:10 PM
Hi Ivan,

the workaround works - problem solved.

Thanks, Michael
0
Michael Storchmann
Top achievements
Rank 1
answered on 30 Nov 2011, 11:10 PM
Hi Ivan,

the workaround works - problem solved.

Thanks, Michael
0
OD
Top achievements
Rank 1
answered on 01 Feb 2017, 09:49 AM

Hello,

Do you know when this problem will be solved ? I use telerik radcontrols Q3 2016 SP1.

Thanks in advance.

Best regards.

0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 01 Feb 2017, 10:31 AM
Hello Jean-Marc,

Thank you for writing.  

I suppose that you are referring to the issue related to the categories in RadPropertyGrid. The problem was addressed in version 2011.3.11.1219. Hence, in the specified version Q3 2016 SP1 you are not supposed to experience the issue. I have attached a sample project for your reference.

I hope this information helps. Should you have further questions I would be glad to help.

 Regards,
Dess
Telerik by Progress
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
OD
Top achievements
Rank 1
answered on 01 Feb 2017, 11:02 AM

Hello Dess,

Thank you for your quick answer.

Sorry, but i have understood, that it will be possible in a future version, but i was wrong (i understood that reading another time the post).

Sorry for the inconvenience.

Your solution works.

Thanks.

0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 01 Feb 2017, 11:09 AM
Hello Jean-Marc, 

Thank you for writing back. 

This is an old forum post from 2011. That is why it was noted that would be addressed in a future release.

If you have any additional questions, please let me know. 

Regards,
Dess
Telerik by Progress
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
PropertyGrid
Asked by
Michael Storchmann
Top achievements
Rank 1
Answers by
Ivan Petrov
Telerik team
Michael Storchmann
Top achievements
Rank 1
OD
Top achievements
Rank 1
Dess | Tech Support Engineer, Principal
Telerik team
Share this question
or