Hola!
Cuando tengo dibujado un grid en pantalla y quiero volver a 'dibujar' otro sobrescribiendo el anterior me sale un mensaje: key aldready exist.
¿Como puedo limpiar un grid para poder volver a dibujar en el?
Gracias de antemano
Public Sub LimpiarGrid(gridpas as infragistics.Win.UltraWingrid.Ultragrid)
try
for each ro as infragistics.Win.UltraWingrid.ultragridrow in gridpas.rows
ro.delete(false)
next
catch ex as exception
End Try
if gridpas.rows.count>0 then
LimpiarGrid(gridpas)
End if
Hi Jhon,
I'm not sure if this is a question or why you are posting on a thread that's been closed for over 5 years. But the code you have here will not work, because you should never delete items in a collection inside a ForEach loop. This will almost certainly cause an exception because the iterator for the collection will not be able to deal with modifications to the loop while it's looping.