Click here to Skip to main content
15,885,546 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a GridView with a Checkbox Column, normal Text Colums and one Richtext Column.

Wenn the checkbox in one row is checked, I want to select and copy all formatted text from the Richtext cell in that row.

That does not work because the editingControl is Nothing.

When I use manual Clicks, I need one click to enter the cell, another one to start Edit Mode and a double click to select the Richtext.

My favorite version wold be, to check a checkbox with the mouse and select and copy the formatted richtext via code.


VB
Private Sub LogReview_CheckBoxCellClick(sender As Object, e As EventArgs) Handles masterDetail.DoubleClick 

        Dim strLineNr As String
        Dim strLine As String

        masterDetail.CurrentRow.Cells(6).Selected = True

        editingControlRTF.SelectAll()
        strLine = editingControlRTF.SelectedText


What I have tried:

I have tried diferent handles

VB
Handles masterDetail.DoubleClick, masterDetail.CurrentCellDirtyStateChanged, masterDetail.CellContentClick


The result is as described above.
Posted
Updated 27-Oct-20 8:52am
v2

1 solution

Well this seems to work with the code I already had:

EditMode: EditOnEnter for the gridview editmode property

allows to check a checkbox with the mouse and select and copy the formatted richtext with code.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900