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

Binding a GridViewDataColumn.CellTemplate to a Dictionary

1 Answer 29 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Charles
Top achievements
Rank 1
Charles asked on 10 Mar 2016, 04:49 PM

I have a gridview bound to a dictionary... working well except this part.  I'm trying to pass a the value component of the item in the grid as a command parameter to the view model.  I get a null object as the parameter.  examples of this anywhere?

 

when the collection was just an observable collection the xaml worked as follows:

CommandParameter= {Binding}

this gave me the item in the collection as the command parameter.  When i changed my collection to a dictionary (from observableCollection) it started being null.     

1 Answer, 1 is accepted

Sort by
0
Martin
Telerik team
answered on 14 Mar 2016, 10:52 AM
Hi Charles,

I tried a similar solution on my side and unfortunately, I was not able to reproduce the problem. I have RadGridView bound to a dictionary and when I am trying to pass the value component of the item in the grid as a command parameter to the ViewModel everything seems to work as expected. The value is sent to the ViewModel. Attached you can find the project I used for the test. Please give it a try and let me know in case I am missing something.


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