Hello,
my problem : if a user, change value on grid1, i want to check if i can make the same modification for other lines in the same grid1. This is my code bellow.
The problem is, when i find other line to modify, i restart directly to the AfterCellUpdate events. And i can't change multiple lines.
Private Sub UltraGrid1_AfterCellUpdate(ByVal sender As Object, ByVal e As Infragistics.Win.UltraWinGrid.CellEventArgs) Handles UltraGrid1.AfterCellUpdate'Je lance la routineRoutine_ultragrid1_01(e.Cell.Value)End Sub Private Sub Routine_ultragrid1_01(ByVal VALEUR As String) If UltraGrid1.ActiveRow.Appearance.BackColor = Color.Plum ThenIf MsgBox("Do you want to apply this parameter for all items in the same zone ?", MsgBoxStyle.YesNo) = MsgBoxResult.Yes Then 'Alors j'aplique la meme valeur a toutes les lignes que je trouve.Dim band As UltraGridBand = Me.UltraGrid1.DisplayLayout.Bands(0)Dim row As UltraGridRowDim Item_modif As String = UltraGrid1.ActiveRow.Cells(0).ValueDim cell_modif As String = UltraGrid1.ActiveCell.Column.Key.ToString For Each row In band.GetRowEnumerator(GridRowType.DataRow) If row.Cells("Cust Art Nb").Value = Item_modif Then row.Cells(cell_modif).Value = VALEUR'Here, instead of finish the loop, the program normaly go to the UltraGrid1_AfterCellUpdate event'And that's the problem !!! End IfNext rowEnd IfEnd IfEnd Sub
thank you for your help
You can cancel the event Temporarily:
ultraGrid1.EventManager.SetEnabled(Infragistics.Win.UltraWinGrid.GridEventIds.AfterCellUpdate, false);// Do some updatesultraGrid1.EventManager.SetEnabled(Infragistics.Win.UltraWinGrid.GridEventIds.AfterCellUpdate, true);
It works !
thank you very much.