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

GridViewComboBoxColumn from ENUM

3 Answers 245 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Felix
Top achievements
Rank 1
Felix asked on 06 Jun 2011, 08:33 PM
Hi,

    After researching the forum and all available examples I still have a problem.
    Dear Telerik team members, before you post here an examples please make sure you read carefully this question:

    I have a simple enum (for populating GridViewComboBoxColumn options), and integer value representing the current  value for each row/combobox
    I need to bind the enum to the GridViewComboBoxColumn using XAML only (without setting the code-behind as I use MVVM) and without creating for this an extra custom class
    In all examples that I found on your web site you use an extra custom class to represent the data and connect it to the GridVeiw

    Please provide an example that will have a DataGrid with GridViewComboBoxColumn that is databinded to an enum directly

    Thank you!

3 Answers, 1 is accepted

Sort by
0
John
Top achievements
Rank 1
Veteran
answered on 11 Aug 2014, 04:11 PM
Felix,

I'm still working on a similar solution.  Did you ever figure out how to bind your GridViewComboBoxColumn to an enum?  I've got the binding working, but no drop down value is selected when the data is populated.

Thanks,
John
0
Boris
Telerik team
answered on 13 Aug 2014, 11:12 AM
Hello John,

You can check our ComboBoxColumn WPF / Silverlight demo. In it, on the left side of the screen you will find a RadComboBox, from which you can choose what kind of binding you want to use. For example there is an option for "Simple binding to enum" that will suit your case.

In addition there is another approach with which you can achieve something similar. All you need to do is replace the GridViewComboBoxColumn with any other column and set its CellTemplate property to contain a RadComboBox. Then follow the example in this How to bind an ItemsControl to the values of an enumeration blog post. 

I hope this helps.

Regards,
Boris Penev
Telerik
 
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
 
0
Joel Palmer
Top achievements
Rank 2
answered on 09 Jan 2017, 03:35 AM
Your "How to bind..." link is invalid.
Tags
GridView
Asked by
Felix
Top achievements
Rank 1
Answers by
John
Top achievements
Rank 1
Veteran
Boris
Telerik team
Joel Palmer
Top achievements
Rank 2
Share this question
or