For some of the records I am setting DataRecordCellAread.IsEnabled = False. As result the row turns readonly.
However, I would like to user to be able select the cell(s) to allow them to copy the data presented in the cells.
How can I achieve this?
PS: I have setup IsEnabled property to prevent user from editing anything on the row. I am happy to change to something else if there is other property to allow me to disable editing at row level but still alllow me to select/copy the content.
HI Bhavesh,
I am attaching a sample that makes the first cell readonly.
You can still select a readonly cell and copy it.
Please review my sample.
Hi Matt,
Thanks for the sample. Since I have styled the DataRecordCellArea to be disabled. I added the following xaml to the example. After making the change, I am not able to select individual cells.
<igDP2:XamDataGrid.Resources><Style TargetType="igDP2:DataRecordCellArea" BasedOn="{StaticResource {x:Type igDP2:DataRecordCellArea}}"><Style.Setters><Setter Property="IsEnabled" Value="False"></Setter></Style.Setters></Style> </igDP2:XamDataGrid.Resources>
Thanks,
Bhavesh
HI,
The style you added prevents you from selecting cells. My sample made the cell readonly and so I could still select it.
You can make the cells using this code snippet:
<igDP2:XamDataGrid.FieldSettings>
<igDP2:FieldSettings AllowEdit="False"/>
</igDP2:XamDataGrid.FieldSettings>
My aim was to make all the cells readonly. Is there a setting to allow me set all the cells readonly? Or I have to iterate through the cells and mark them as readonly.
Thanks,Bhavesh