Tema: String Grids
Ver Mensaje Individual
  #4  
Antiguo 02-09-2004
Avatar de naker
naker naker is offline
Miembro
 
Registrado: nov 2003
Ubicación: Tandil, BsAs, Argentina
Posts: 12
Reputación: 0
naker Va por buen camino
Detalle.Cells[0,indiceGrid]:=Cant.Text;
Detalle.Cells[1,indiceGrid]:=CodProducto.Text;
Detalle.Cells[2,indiceGrid]:=DbGrid.DataSource.DataSet.Fields[1].AsString; //descripcion
Detalle.Cells[3,indiceGrid]:=DbGrid.DataSource.DataSet.Fields[2].AsString; //precio unitario
Detalle.Cells[4,indiceGrid]:=FloatToStr(StrToFloat(Cant.Text)*StrToFloat(DbGrid.datasource.DataSet.Fields[2].AsString)); //subtotal
total.Text:=FloatToStr(StrToFloat(total.Text) + StrToFloat(Detalle.Cells[4,indiceGrid]));
indiceGrid:=indiceGrid+1;
Detalle.RowCount:=indiceGrid;

donde indiceGrid es una variable global que lleva el indice en donde debo insertar el nuevo elemento..
Responder Con Cita