Quantcast
Viewing all articles
Browse latest Browse all 12583

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

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