This example demonstrates how to provide the capability to an end-user to edit multiple selected cells values at once:
Question Comments
Added By: Gwan jung at: 6/13/2013 6:28:08 PM
this code worked perfectly except columns filter exist...
Case :
1. column[0] has filter string "mike"
2. row[0][0] ~ row[10][0] has "mike" value
3. multi select row[1][0] ~ row[4][0]
4. click one of this cells again, delete mike
in that case, mulit edit function work strange....
Added By: Keite Tuane Carvalho at: 2/5/2015 10:15:42 AMHow I can save these records changed in the database?
Added By: Svetlana (DevExpress Support) at: 2/5/2015 12:45:43 PMHello,
To process your recent post more efficiently, I created a separate ticket on your behalf: T205671: How to save changes from a grid to a data base. This ticket is currently in our processing queue. Our team will address it as soon as we have any updates.
Hello,
I've created a separate ticket on your behalf (T455008: E2779 - If you mark multiple cells to change them all, then type in the same text as already in the focused cell, no cells in the selection are changed). It has been placed in our processing queue and will be answered shortly.
This is a great piece of code!
May I suggest a small addition to make this even better?
I reckon, that in real-world applications, you most probably wouldn't want to change values of different rows and different columns in one go - only values of the same column in different rows.
To do this, I introduced a private variable of GridColumn type and modified OnCellValueChanged and SetSelectedCellsValues methods to make sure only cells in the same column as the one edited are affected.
It is a little misleading because I wasn't able to figure out how to disallow selection of cells in other columns, but it works (unless you notice something wrong with it).
[VB.NET]Private EditColumn As GridColumnPrivateSub OnCellValueChanged(ByVal e As CellValueChangedEventArgs)If lockEvents ThenReturnEndIf lockEvents = True EditColumn = e.Column SetSelectedCellsValues(e.Value) lockEvents = FalseEndSubPrivateSub SetSelectedCellsValues(ByVal value AsObject)Try _View.BeginUpdate()Dim cells() As GridCell = _View.GetSelectedCells()ForEach cell As GridCell In cellsIf cell.Column Is EditColumn Then _View.SetRowCellValue(cell.RowHandle, cell.Column, value)EndIfNext cellCatch ex As ExceptionFinally _View.EndUpdate()EndTryEndSub
Best regards,
Nassos
Added By: Nadezhda (DevExpress Support) at: 12/25/2017 4:37:56 AM
Hello,
I've created a separate ticket on your behalf (GridView - How to select cells of one column). It has been placed in our processing queue and will be answered shortly.