Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
678
Aftercellupdate infiniti loop
posted

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 routine
Routine_ultragrid1_01(e.Cell.Value)
End Sub

Private Sub Routine_ultragrid1_01(ByVal VALEUR As String)  

If
UltraGrid1.ActiveRow.Appearance.BackColor = Color.Plum Then
If 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 UltraGridRow
Dim Item_modif As String = UltraGrid1.ActiveRow.Cells(0).Value
Dim 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 If
Next row

End
If
End If
End Sub

thank you for your help

Parents
  • 17259
    Verified Answer
    Offline posted

    You can cancel the event Temporarily:

    ultraGrid1.EventManager.SetEnabled(Infragistics.Win.UltraWinGrid.GridEventIds.AfterCellUpdate, false);
    // Do some updates
    ultraGrid1.EventManager.SetEnabled(Infragistics.Win.UltraWinGrid.GridEventIds.AfterCellUpdate, true);

Reply Children
No Data