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

[Solved] Editable DataGridTemplateColumn?

1 Answer 250 Views
Grid for XAML
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Kevin
Top achievements
Rank 1
Kevin asked on 07 May 2014, 10:14 PM
Hello,

Is it possible to make a DataGridTemplateColumn to be editable? I need to edit a field which shows an enum as string.
Also, is it possible to bind a cell's "edit mode" status so that it changes according to other cell's status. For example, I want to enable/disable a cell's edit mode depending on a true/false value in the same row changes.

1 Answer, 1 is accepted

Sort by
0
Rosy Topchiyska
Telerik team
answered on 13 May 2014, 08:10 AM
Hi Kevin,

Thank you for writing and sorry for the late reply.

The DataGridTemplateColumn does not support editing functionality. This means that you will have to implement your own way to edit the cell content in the templated column. In your case with enums, you could use DataGridTemplateColumn with ComboBox as DataTemplate and bind the ComboBox.IsEnabled property to the property that defines whether the cell could be edited.

All other types of columns support editing functionality and you can control their CanUserEdit mode with a custom DataGridCommand. You can read more about the grid commands in these articles from our online documentation:

I have attached a sample project that demonstrates how you can create a DataGridTemplateColumn that uses a ComboBox to select a value from enum and how to use the BeginEdit command to change the CanUserEdit mode for the other grid columns.

I hope this helps. Please, let us know if you have further questions.

Regards,
Rosy Topchiyska
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
Grid for XAML
Asked by
Kevin
Top achievements
Rank 1
Answers by
Rosy Topchiyska
Telerik team
Share this question
or