Home Forums WinForms controls Xceed Grid for WinForms Updating rows in a group Reply To: Updating rows in a group

User (Old forums)
Post count: 23064

Just check out the coding and let me know where I went wrong.

In form load event i added:

Dim cell As DataCell
For Each cell In GridControl1.DataRowTemplate.Cells
AddHandler cell.LeavingEdit, AddressOf Me.cells_LeavingEdit
Next cell

Then the event is called

Private Sub cells_LeavingEdit(ByVal sender As Object, ByVal e As LeavingEditEventArgs)
Dim cell As Cell = CType(sender, Cell)
Dim columnindex
Dim datarow As DataRow
columnindex = cell.ParentColumn.Index
Dim row As CellRow = cell.ParentRow
Dim group As GroupBase = row.ParentGroup
If IsDBNull(group) = False Then
For Each datarow In group.GetSortedDataRows(True)
If datarow Is row Then
datarow.Cells(columnindex).value = e.NewValue
End If
End If
End Sub

Imported from legacy forums. Posted by prem_rajani (had 352 views)