The inner text of the DevExpress GridControl cell can be selected but not edited

GridControl works like ~ Excel natively:

  • Clicking once in a cell selects . The copy copies the cell value and title.
  • Clicking twice on a cell selects the inner text . Copy only copies the inner text.

I am working on preventing cell release by binding an event ShowingEditor

setting the version to e.Cancel

.

However, this prevents behavior 2. above. I would like to be able to select the inner text to copy , just so that I am not editable .

Do you know how to do it? Fyi, this behavior can be achieved at the column level by setting the parameter ReadOnly

to true:

<dxg:GridControl.Columns>
    <dxg:GridColumn FieldName="field" ReadOnly="True"/>

      


EDIT

My grid is set up like this:

<dxg:GridControl>
    <dxg:GridControl.Resources>
    </dxg:GridControl.Resources>
    <dxg:GridControl.View>
        <dxg:GridControl.TableView>
        </dxg:GridControl.TableView>
    </dxg:GridControl.View>
    <dxg:GridControl.Columns>
    </dxg:GridControl.Columns>
</dxg:GridControl>

      

Thank!

0


source to share


1 answer


You tried

GridView.OptionsBehavior.CopyToClipboardWithColumnHeaders = False

      



Also you can try this approach suggested by DevExpress

Copy the contents of an individual cell to the clipboard from the XtraGrid when the user presses Ctrl + C

0


source







All Articles