Ver Mensaje Individual
  #3 (permalink)  
Antiguo 03/12/2010, 10:02
roger1187
 
Fecha de Ingreso: marzo-2008
Mensajes: 286
Antigüedad: 16 años, 1 mes
Puntos: 1
Respuesta: Actualizar combobox dentro de un datagridview

Hola dr. recien he tenido un tiempo para poder revisar el codigo, pero me da un error no se si sabras porque es.

Referencia a objeto no establecida como instancia de un objeto.

el codigo que me pasaste lo deje asi ya con los nombres de mis columnas

Cita:
Private Sub m_dgv_detalle_CellValueChanged(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles m_dgv_detalle.CellValueChanged
With m_dgv_detalle
If .CurrentCell Is Nothing Then
Exit Sub
End If
If .CurrentCell.OwningColumn.Name = "txt_intero" AndAlso .CurrentCell.Value IsNot DBNull.Value Then
'llamamos a la función que cargará las unidades y le enviamos la fila actual
CargarUnidadesEnCombo(.CurrentRow)
End If
End With
End Sub
Cita:
Private Sub CargarUnidadesEnCombo(ByVal fila As DataGridViewRow)
Dim idArticulo As String
Dim dt As New DataTable
idArticulo = fila.Cells("txt_intero").Value
'Llamamos a una funcion que devuelve una Tabla con las unidades, dependiendo del codigo de producto
Dim Celda As DataGridViewComboBoxCell = DirectCast(fila.Cells("txt_unidad").Value, DataGridViewComboBoxCell)
Dim parr(2) As System.Object
parr(0) = "aqa"
parr(1) = "B"
parr(2) = idArticulo
Dim ds As DataSet = ServicioWeb.EjecutarWS("sp_inv_articulo_unidad_sel ectcombo", parr)
If Not ds Is Nothing Then
dt = ds.Tables(0)
With Celda
.DataSource = dt
.ValueMember = "cod_unidad"
.DisplayMember = "des_unidad"
End With
End If
End Sub
no se si podrias ayudarme el porque me sale ese error.

Saludos