DataBinding sólo es válido para visualizar?

  • Thread starter Thread starter Felix González
  • Start date Start date
F

Felix González

Hola
pregunto esto porque cuando quiero insertar una nueva fila, los valores de
los campos no se toman de los cotroles a los cuales están enlazadsos, tengo
que asignarlos manualmente.
Estoy progrmando en c# para una PDA.
Tengo unos Text enlazados a campos de una tabla. Cuando quiero insertar una
fila tengo que hacer algo así:

txtBloque.DataBindings.Add(new Binding("Text", ds.Tables["Medicion"],
"Bloque"));
txtPlanta.DataBindings.Add(new Binding("Text", ds.Tables["Medicion"],
"Planta"));
..........
fila = Tables["Medicion"].NewRow();
fila["Bloque"] = txtBloque.Text;
fila["Planta"] = txtPlanta.Text;
...............................
ds.Tables["Medicion"].Rows.Add(fila)

mi pregunta es: las asignaciones de datos a la nueva fila fila["Bloque"]....
por que necesito hacerlas? si no las hago toman valores nulos. No deberían
inicializarse estas columnas con los valores de los text a los cuales están
enlazados? o esty haciendo algo mal?

Gracias
 
Google translation works :D....translated from Spanish:

"Hello I ask this because when I want to insert a new row, the values of the
fields are not taken from the cotrolley poles to which they are enlazadsos, I
must assign them manually. I am progrmando in c # for a PDA. I have a Text
connected to fields of a table. When I want to insert a row I must do
something asi ': txtBloque.DataBindings.Add(new Binding("Text ",
ds.Tables["Medicion "]," Block")); txtPlanta.DataBindings.Add(new
Binding("Text ", ds.Tables["Medicion "]," Plant"));.......... row =
Tables["Medicion"].NewRow(); fila["Bloque "] = txtBloque.Text; fila["Planta
"] = txtPlanta.Text; ...............................
ds.Tables["Medicion"].Rows.Add(fila) my question is: the allocations of data
to the new row fila["Bloque "].... so that I need to do them? if I do not
do them they take null values. Would not have to be initialized these
columns with the values of text to which they are connected? or esty doing
something badly? Thanks"
 
Back
Top