Ver Mensaje Individual
  #4 (permalink)  
Antiguo 30/09/2010, 10:56
Avatar de PosProdukcion
PosProdukcion
 
Fecha de Ingreso: noviembre-2004
Ubicación: Manzanares el Real (Madrid)
Mensajes: 726
Antigüedad: 20 años, 2 meses
Puntos: 9
Respuesta: Pintar imagen en DataGridView con celdas tipo botón

Disculpas por resucitar un tema antiguo pero es para poner la solución por la que opté al final...

Lo resolví poniendo celdas tipos imagen y programando el evento CellClick del grid poniendo casos para cada una de estas celdas tipo "falso botón":

Código vb:
Ver original
  1. Private Sub myDataGrid_CellClick(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles myDataGrid.CellClick
  2.         If (CInt(e.ColumnIndex.ToString) >= 0) Then
  3.             If Me.myDataGrid.Columns(e.ColumnIndex).Name = "btDetalle" Then
  4.                 call mostrarDetalle()
  5.             ElseIf Me.myDataGrid.Columns(e.ColumnIndex).Name = "btAsignar" Then
  6.                 Call asignarObjeto()
  7.             ElseIf Me.myDataGrid.Columns(e.ColumnIndex).Name = "btBorrar" Then
  8.                 Call borrarFila()
  9.             End If
  10.         End If
  11.     End Sub

No se si habrá otra solución mejor con botones-imagen reales pero esta funciona bien.

Saludos