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
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
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.
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
Hi Stefan,
Sorry for late reply. Can you please provide sample application.
Regards,
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