ComboBox en Datagrid

26/10/2004 - 02:12 por Aldo Dell | Informe spam
Hola amigos!

¿Cómo puedo hacer que un DataGrid muestre en algunas celdas un ComboBox en
lugar de un TextBox o un CheckBox?

PD: sirva de ejemplo las tablas de ACCESS cuando se vincula un campo a otra
tabla.

Muchas gracias!
Aldo Dell, Venezuela.

Preguntas similare

Leer las respuestas

#1 Angel. E. Ruiz. Pastor
26/10/2004 - 03:56 | Informe spam
Estimado Aldo,





Prueba con este código.





Private Sub TuDataGrid_CurrentCellChanged(ByVal sender As Object, ByVal e As
System.EventArgs) _ Handles TUDATAGRID.CurrentCellChanged If
TuComboBox.Visible = True Then TuComboBox.Visible = False If
TUDATAGRID.CurrentCell.ColumnNumber <> 2 Then Exit Sub Dim CeldaAlto
As Integer = TUDATAGRID.GetCellBounds(TUDATAGRID.CurrentCell.RowNumber,
TUDATAGRID.CurrentCell.ColumnNumber).Height Dim CeldaAncho As Integer
= TUDATAGRID.GetCellBounds(TUDATAGRID.CurrentCell.RowNumber,
TUDATAGRID.CurrentCell.ColumnNumber).Width Dim PosicionX As Integer TUDATAGRID.GetCellBounds(TUDATAGRID.CurrentCell.RowNumber,
TUDATAGRID.CurrentCell.ColumnNumber).X + TUDATAGRID.Left Dim
PosicionY As Integer TUDATAGRID.GetCellBounds(TUDATAGRID.CurrentCell.RowNumber,
TUDATAGRID.CurrentCell.ColumnNumber).Y + TUDATAGRID.Top
TuComboBox.Left = PosicionX TuComboBox.Top = PosicionY
TuComboBox.Height = CeldaAlto TuComboBox.Width = CeldaAncho
TuComboBox.Visible = True TuComboBox.DroppedDown = TrueEnd Sub Nota:
TuComboBox =Nombre de tu TuComboBox. Private Sub
TuTuComboBoxBox_SelectedIndexChanged(ByVal sender As System.Object, ByVal e
As System.EventArgs) _ Handles TuComboBox.SelectedIndexChanged
TUDATAGRID.Text = TuComboBox.Text TuComboBox.Visible = FalseEnd Sub








Saludos cordiales,
Ángel Ruiz
[MS Visual Basic Developer MVP]
Caracas - Venezuela

"El conocimiento es un bien, que crece a medida que se comparte"



NOTA. Por favor, las preguntas y comentarios en los grupos, así nos
beneficiamos todos.



"Aldo Dell" wrote in message
news:%
Hola amigos!

¿Cómo puedo hacer que un DataGrid muestre en algunas celdas un ComboBox en
lugar de un TextBox o un CheckBox?

PD: sirva de ejemplo las tablas de ACCESS cuando se vincula un campo a


otra
tabla.

Muchas gracias!
Aldo Dell, Venezuela.


Respuesta Responder a este mensaje
#2 Aldo Dell
26/10/2004 - 04:02 | Informe spam
Muchas gracias Angel, voy a probarlo de inmediato!!!

Aldo.
email Siga el debate Respuesta Responder a este mensaje
Ads by Google
Help Hacer una preguntaRespuesta Tengo una respuesta
Search Busqueda sugerida