Hello,
I have some problem with UltraWinGrid. I modify some Cell when i running, but if i modifed a grouped Cell, le group isn't refresh.
i programming that for repair the problem
-----------------------------------
Private Sub UltraGrid_AfterCellUpdate(ByVal sender As Object, ByVal e As Infragistics.Win.UltraWinGrid.CellEventArgs) Handles UltraGrid.AfterCellUpdate If isGrouped(e.Cell.Column.Index) Then ResetGroup() End If End Sub
Private Function isGrouped(ByVal Colomns As Integer) For i As Integer = 0 To Me.UltraGrid.DisplayLayout.Bands(0).SortedColumns().Count - 1 If Me.UltraGrid.DisplayLayout.Bands(0).SortedColumns(i).Index = Colomns Then Return True End If Next i Return False End Function Private Sub ResetGroup() Dim liste As New Generic.List(Of Colomns) For i As Integer = 0 To Me.UltraGrid.DisplayLayout.Bands(0).SortedColumns().Count - 1 Dim temp As Colomns temp.Colomns = Me.UltraGrid.DisplayLayout.Bands(0).SortedColumns(i) temp.descending = Me.UltraGrid.DisplayLayout.Bands(0).SortedColumns(i).SortIndicator = Infragistics.Win.UltraWinGrid.SortIndicator.Descending temp.groupBy = Me.UltraGrid.DisplayLayout.Bands(0).SortedColumns(i).IsGroupByColumn liste.Add(temp) Next i Me.UltraGrid.DisplayLayout.Bands(0).ColumnFilters.ClearAllFilters() Dim iterator As Generic.List(Of Colomns).Enumerator = liste.GetEnumerator While iterator.MoveNext Me.UltraGrid.DisplayLayout.Bands(0).SortedColumns.Add(iterator.Current.Colomns, iterator.Current.descending, iterator.Current.groupBy) End While End Sub
That work, all group is refresh and if i modify a cell and this cell is grouped, the rows change of group
but the problem, all group is collapse.
How i can expand some group by the code ???
Thanks
Waxime
Softicket Programmer
http://www.softicket.net
The grid does not automatically re-group or re-sort when the value of a cell changes, because this might be jarring for users to edit a cell and have the row move to a new position.
But if you want to refresh the sorting or grouping, all you have to do is call:
private void ultraGrid1_AfterCellUpdate(object sender, CellEventArgs e) { e.Cell.Band.SortedColumns.RefreshSort(true); }
Hi Mike,
won't it effect the performance (cell updation), if the grid cells is getting updated very frequently...
you say that now !!!! lol
my correction, little more complexe, but work perflectly. Expended, reset sort and reset group include
---------------------------------
If Me.UltraGrid.DisplayLayout.Bands(0).SortedColumns(i).Index = Colomns Then
Return True
End If
Return False
End Function
Dim listeRow As New Generic.Dictionary(Of String, Boolean)
For i As Integer = 0 To Me.UltraGrid.Rows.Count - 1
Next i
Dim temp As Colomns
temp.descending = Me.UltraGrid.DisplayLayout.Bands(0).SortedColumns(i).SortIndicator = Infragistics.Win.UltraWinGrid.SortIndicator.Descending
liste.Add(temp)
Me.UltraGrid.DisplayLayout.Bands(0).ColumnFilters.ClearAllFilters()
While iterator.MoveNext
End While
While iterator2.MoveNext
If Not IsNothing(row) Then
If iterator2.Current.Value Then
row.ExpandAll()
Else
row.CollapseAll()
End Sub
If Split(Split(Me.UltraGrid.Rows(i).Description, " : ")(1), " (")(0) = description Then
Return Nothing