Desde ahora muchas gracias por sus aportaciones...
A continuacion el Codigo
Código:
Me.Cursor = Cursors.WaitCursor 'Inicializar cursor de la aplicacion contador1 = 0 For contador = 0 ToMe.dgdMaterias.Rows.Count - 1 If Me.dgdMaterias.Rows(contador).Visible = FalseThen contador1 = contador1 + 1 EndIf Next If Me.dgdMaterias.Rows.Count <> contador1 Then For contador1 = contador1 ToMe.dgdMaterias.Rows.Count - 1 Me.dgdMaterias.CurrentCell = Me.dgdMaterias.Rows(contador1).Cells(1) renglon = Me.myDataMateriasAlumno.NewRow With renglon .Item("ClaveMateria") = Me.dgdMaterias.CurrentRow.Cells(1).Value .Item("NombreMateria") = Me.dgdMaterias.CurrentRow.Cells(2).Value .Item("IdMateria") = Me.dgdMaterias.CurrentRow.Cells(0).Value EndWith Me.myDataMateriasAlumno.Rows.Add(renglon) indiceRenglonGrid = Me.dgdMaterias.CurrentRow.Index Me.dgdMaterias.CurrentCell = Nothing Me.dgdMaterias.Rows(indiceRenglonGrid).Visible = False Next Else MsgBox(mdlMensajesPublicos.ObtenerMensajeAplicacion("ER101"), MsgBoxStyle.Critical + MsgBoxStyle.OkOnly, mdlMensajesPublicos.ObtenerMensajeAplicacion("ER000")) 'Obtener el mensaje y enviar mensaje EndIf Me.Cursor = Cursors.Default 'Inicializar cursor de la aplicacion