Hi,
I have a XamDataGrid bound to a DataTable that contains business objects which have a double Value property and an override of ToString() that returns Value.ToString(). The grid displays the business object's values, but it does not allow editing of these values even though the grid's FieldSettings.AllowEdit = "True".
How can I get these cells to be editable while maintaining the grid's multiselect and copy and paste functionality? I've tried setting a DataTemplate for the CellValuePresenterStyle, but this loses the grid's multiselect functionality I require via FieldLayoutSettings SelectionTypeRecord="Range":
<DataTemplate x:Key="myBusinessObjectCell" DataType="{x:Type MyBusinessObject}">
<igEditors:XamTextEditor Text="{Binding Path=Value,Mode=TwoWay}" />
</DataTemplate>
If I replace XamTextEditor with SimpleTextBlock in the above DataTemplate, I get the multiselect working, but lose the ability to edit or paste into the cell.
Is there a way of achieving this without a DataTemplate?
Thanks!
Hi Robert,
I am glad that you have managed to solve your issue.
Hi Yanko,
That link helped me to get things working.
Thanks for your help!
Hello Robert,
Here you can find how to define your field layout in XAML and in code-behind :
http://help.infragistics.com/NetAdvantage/WPF/2012.2/CLR4.0/?page=xamDataPresenter_Define_a_Field_Layout.html
Please create a new forum thread for every question different from the topic of your original one.
This way other visitors of our community can get benefit from that.
Thank you for the understanding.
I've now created a new FieldLayout in the code behind and added it to the grid's FieldLayouts. How do I configure the grid to use this new FieldLayout in the code behind?
You need to set the ‘AutoGeneratedFields’ property to “False” :
<igDP:XamDataGrid.FieldLayoutSettings>
<igDP:FieldLayoutSettings AutoGenerateFields="False"/>
</igDP:XamDataGrid.FieldLayoutSettings>
Let me know, if you need any further assistance on this matter.