Binding a GridViewDataColumn.CellTemplate to a Dictionary

2 posts, 0 answers
  1. Charles
    Charles avatar
    5 posts
    Member since:
    Feb 2015

    Posted 10 Mar Link to this post

    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.     

  2. Martin Vatev
    Admin
    Martin Vatev avatar
    87 posts

    Posted 14 Mar Link to this post

    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.
  3. UI for WPF is Visual Studio 2017 Ready
Back to Top