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

How ti bind dictionary to RadProperty grid

5 Answers 240 Views
PropertyGrid
This is a migrated thread and some comments may be shown as answers.
Rajendar
Top achievements
Rank 1
Rajendar asked on 15 Sep 2016, 10:19 AM

Hi Everyone,
I want to bind Dictionary to Rad property grid. But this dictionary keys and values are run time generator. When I choose DB1 it may be 3 keys and 3 values if I choose DB2 it may be 8 keys and 8 values. Here I don’t want to update Property Grid Xaml when Dictionary values changes.
Can anyone provide solution with help of sample application as soon as possible.

Regards,
Rajendar.

5 Answers, 1 is accepted

Sort by
0
Stefan
Telerik team
answered on 19 Sep 2016, 03:04 PM
Hello Rajendar,

In order to ensure that we are on the same page, can you please some more details about your requirement? If I am understanding you correctly, you need to be able to change the source collection, but not affect the UI? Can you please confirm that?

Regards,
Stefan X1
Telerik by Progress
Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
0
Rajendar
Top achievements
Rank 1
answered on 20 Sep 2016, 04:54 AM

Hi Stefan,

I have dictionary  something like below.

Dictionary<string, string> dictionary = new Dictionary<string, string>();
dictionary.Add(“appu”,”100”);dictionary.Add(“sree”,”101”);dictionary.Add(“khan”,”111”);

Property Grid
appu 100
Sree 101
Khan 111

Whenever new person join I will add new entry in dictionary. That should reflect in property grid.

Regards,

Rajendar.


0
Accepted
Stefan
Telerik team
answered on 22 Sep 2016, 02:15 PM
Hello Rajendar,

Thanks for this clarification.

In order the control to be updated when an item is added, a collection changed notification should be raised. As this is not supported by the default IDictionary, you may consider implementing an ObservableDictionary. Please take a look at the Binding to a Dictionary blog post and the .NET ObservableDictionary StackOverflow thread for more information on the matter.

I hope you find these resources helpful.

Regards,
Stefan X1
Telerik by Progress
Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
0
Rajendar
Top achievements
Rank 1
answered on 14 Oct 2016, 10:22 AM

Hi Stefan,

Sorry for late reply. Can you please provide sample application.

Regards,

Rajendar

0
Stefan
Telerik team
answered on 18 Oct 2016, 10:50 AM
Hi Rajendar,

In order to provide you with an appropriate example, may I ask you what requirements do you need to satisfy with RadPropertyGrid? Are you just trying to populate the objects from the dictionary, or you are planning to use some of the functionalities of the  control?

Regards,
Stefan X1
Telerik by Progress
Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
Tags
PropertyGrid
Asked by
Rajendar
Top achievements
Rank 1
Answers by
Stefan
Telerik team
Rajendar
Top achievements
Rank 1
Share this question
or