otro control en datagrid

24/10/2004 - 00:29 por Jose Barberan | Informe spam
Hola

¿Que se debe hacer para colocar otro control en un datagrid?, por ejemplo un
ComboBox o un CheckBox

Gracias

JB
 

Leer las respuestas

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





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.



"Jose Barberan" wrote in message
news:OLNSI$
Hola

¿Que se debe hacer para colocar otro control en un datagrid?, por ejemplo


un
ComboBox o un CheckBox

Gracias

JB


Preguntas similares