Select the entire box of a DataGridView [closed]

0

I wanted to know how to do to click on a cell to select all the content, because it only remains to edit. PD: SelectAll () would serve but as it is devexpress.

    
asked by Pedro 22.12.2016 в 21:39
source

2 answers

1

If you only want to allow to select, without entering the edit, you should define the grid as ReadOnly = true

On the other hand to select the full row defines

DataGridView.SelectionMode

with the option FullRowSelect in this way the full row will be selected.

If you want to control when editing enters the cell you could define the property EditMode with the value EditProgrammatically and then in the event double click put in cell editing

private void dataGridView1_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
{
    dataGridView1.BeginEdit(true);
}

also remember to define the SelectionMode = FullRowSelect

    
answered by 22.12.2016 в 21:46
0

Your data dataGridView modifies the SelectionMode property

dataGridView1.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
    
answered by 22.12.2016 в 21:56