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

GridView to edit Dictionary

2 Answers 285 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Chris
Top achievements
Rank 1
Chris asked on 24 Dec 2010, 08:51 AM

Hi, I'm new to telerik and I would like to ask a question here in the forum.

Basically, I would like to make  "Property Editor" using Dictionary and RadGridView.

I'm using Dictionary because all I have is bunch of key/value pairs and entries/definition can frequently change. I thought Dictionary was perfect for this.

The below source code works to bind Dictionary in RadGridView but editing value would not work. Any changes made in RadGridView will not change the values in the Dictionary.
It is obvious that Dictionary doesn't support two-way binding.
I'm was wondering how I can enable Dictionary to edit values.
Is there a trick to do that?

If Dictionary inheritantely does not allow two-way/one-way binding, could you please give a suggestion how I can emulate Dictionary like functionality?

Thank you very much.

-Chris

publicvoid
 ShowEntityProperties(OrderedDictionary propertyDict)
  {
   PropertyGridView.ItemsSource = null;
   PropertyGridView.Items.Clear();
   PropertyGridView.ItemsSource = propertyDict;

  }

2 Answers, 1 is accepted

Sort by
0
Pavel Pavlov
Telerik team
answered on 24 Dec 2010, 04:38 PM
Hello Chris ,

You may need to provide some kind of  ViewModel as intermediary object between RadGridView and your Data.
This should be an object which RadGridView can edit . Then on property changes inside the object , you may perform logic to update your original data.



Best wishes,
Pavel Pavlov
the Telerik team
Browse the videos here>> to help you get started with RadControls for WPF
0
Chris
Top achievements
Rank 1
answered on 24 Dec 2010, 07:31 PM
I thought it was pretty common operation but it seems pretty difficult for me to tackle.
Can you please show me some examples that can lead to the solution?
I appreciate for your help.
Thanks
-Chris
LoginiMoon
Top achievements
Rank 1
commented on 11 Aug 2022, 02:33 PM

Chris Did you find the solution for this question?

I am in the same spot

Tags
GridView
Asked by
Chris
Top achievements
Rank 1
Answers by
Pavel Pavlov
Telerik team
Chris
Top achievements
Rank 1
Share this question
or