Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
255
Binding a XamDataGrid's cells to a business object's specific value property while retaining the cell's editing, multiselect and copy and paste functionality
posted

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!