Quantcast
Channel: Windows Forms General forum
Viewing all articles
Browse latest Browse all 12583

Want to select part of text of datagridview textbox column text by mouse c#

$
0
0
I have DataGridView with three column and all three columns are DataGridViewTextBoxColumn and now I want to select cell text by mouse. I tried the following:

dgView.ReadOnly = false;
private void dgView_EditingControlShowing(object sender, DataGridViewEditingControlShowingEventArgs e)
{
    if (e.Control is TextBox)
    {
        (e.Control as TextBox).ReadOnly = true;
    }
}

But this trick is not working.

Viewing all articles
Browse latest Browse all 12583

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>