djoyceRRD
asked on
How to allow mutliple rows to be selected and edit individual cells in DataGridView
I have a datagridview with specific cells that are editable. I also want to allow the user to select multiple rows and click a button that will copy 1 value in the row to another on each row selected. I tried changing dg.selectionMode = "FullRowSelect", but then I can't change the individual cells.
Or a different way to do this would be to get all of the fields associated with the row in which a cell was selected if only cells can be multi-selected.
Or a different way to do this would be to get all of the fields associated with the row in which a cell was selected if only cells can be multi-selected.
The description is not very clear. Please restate the problem.
I hear that the user will be able to select multiple rows, and there is a need to copy 1 value in the row, but it is unclear what the source row is. It might be possible to achieve that effect with copying/pasting techniques, but without further explanation, it is difficult to tell for certain...
ASKER
Sorry, let me try again.
I have a browse that is editable. I also want to let the user select multiple rows and hit a button that will automatically copy a value in the row to another (this will happen row by row). The user won't be doing the copy, the code behind the button will.
I was going to use dg.selectedRows to read through each one selected, but cannot figure out how to let the user select multiple rows while still having individual cells be editable.
I upped the points to 500 since this is a little more confusing.
I have a browse that is editable. I also want to let the user select multiple rows and hit a button that will automatically copy a value in the row to another (this will happen row by row). The user won't be doing the copy, the code behind the button will.
I was going to use dg.selectedRows to read through each one selected, but cannot figure out how to let the user select multiple rows while still having individual cells be editable.
I upped the points to 500 since this is a little more confusing.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Its the place where you see the arrow when you click on a row in the grid. Use can either drag the mouse to select multiple rows or use the CTRL or SHIFT keys.
ASKER
That plus dg.SelectionMode = RowHeaderSelect did it.
Thanks!
Thanks!