Club Delphi  
    FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Otros entornos y lenguajes > Lazarus, FreePascal, Kylix, etc.
Registrarse FAQ Miembros Calendario Guía de estilo Temas de Hoy

Respuesta
 
Herramientas Buscar en Tema Desplegado
  #1  
Antiguo 20-05-2011
Bael_Balzac Bael_Balzac is offline
Registrado
NULL
 
Registrado: may 2011
Posts: 2
Poder: 0
Bael_Balzac Va por buen camino
No puedo editar StringGrid

goEditing esta en True
goTab esta en True

No puedo editar las celdas en tiempo de ejecucion
Código Delphi [-]
unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, Grids;

type
  TForm1 = class(TForm)
    StringGrid1: TStringGrid;
    procedure StringGrid1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.StringGrid1Click(Sender: TObject);
  begin
       with StringGrid1 do
       begin
       Cells[0,0] := 'Nombre';
       Cells[1,0] := 'Apellido paterno';
       Cells[2,0] := 'Apellido materno';
       Cells[3,0] := 'Nota Examen 1';
       Cells[4,0] := 'Nota Examen 2';
       Cells[0,1] := 'Pablo';
       Cells[1,1] := 'Garcia';
       Cells[2,1] := 'Martinez';
       Cells[3,1] := '40';
       Cells[4,1] := '36';
       Cells[0,2] := 'Maria';
       Cells[1,2] := 'Sanchez';
       Cells[2,2] := 'Palazon';
       Cells[3,2] := '50';
       Cells[4,2] := '60';
       Cells[0,3] := 'Carmen';
       Cells[1,3] := 'Perez';
       Cells[2,3] := 'Guillen';
       Cells[3,3] := '70';
       Cells[4,3] := '60';
       end;
end;

end.

Última edición por ecfisa fecha: 21-05-2011 a las 03:38:52. Razón: Etiquetas [DELPHI] [DELPHI]
Responder Con Cita
  #2  
Antiguo 21-05-2011
Avatar de Caral
[Caral] Caral is offline
Miembro Premium
 
Registrado: ago 2006
Posts: 7.659
Poder: 25
Caral Va por buen camino
Hola
Editar ?.
En tiempo de ejecución ?
No entiendo, cual es el problema ?.
Saludos
__________________
Siempre Novato
Responder Con Cita
  #3  
Antiguo 21-05-2011
Avatar de ecfisa
ecfisa ecfisa is offline
Moderador
 
Registrado: dic 2005
Ubicación: Tres Arroyos, Argentina
Posts: 10.508
Poder: 36
ecfisa is a splendid one to beholdecfisa is a splendid one to beholdecfisa is a splendid one to beholdecfisa is a splendid one to beholdecfisa is a splendid one to beholdecfisa is a splendid one to beholdecfisa is a splendid one to behold
Hola Bael_Balzac y bienvenido a los foros del Club Delphi.

En realidad el evento que has elegido para inicializar el TStringGrid no es el mejor, mejor hubiera sido el evento OnShow del form...

Ya que el evento OnClick del TStrinGrid 'generalmente' se dispara por el click del mouse pero tambien cuando:
Cita:
The user selects an item in a grid, outline, list, or combo box by pressing an arrow key.
The user presses Spacebar while a button or check box has focus.
The user presses Enter when the active form has a default button (specified by the Default property).
The user presses Esc when the active form has a cancel button (specified by the Cancel property).
The user presses the accelerator key for a button or check box. For example, if the value of the Caption property of a check box is '&Bold', the B is underlined at runtime and the OnClick event of the check box is triggered when the user presses Alt+B.
The Checked property of a radio button is set to true.
The value of the Checked property of a check box is changed.
The Click method of a menu item is called.
Información de la ayuda de Delphi. (F1)

O sea que en realidad te permite editar, pero te sobreescribe lo editado al dispararse el evento OnClick por los alguno de los motivos arriba mencionados.

Si querés salir de dudas sólo agrega esta línea al inicio del código de tu evento OnClick:
Código Delphi [-]
ShowMessage('OnClick');


Saludos.
__________________
Daniel Didriksen

Guía de estilo - Uso de las etiquetas - La otra guía de estilo ....

Última edición por ecfisa fecha: 21-05-2011 a las 04:03:21.
Responder Con Cita
Respuesta



Normas de Publicación
no Puedes crear nuevos temas
no Puedes responder a temas
no Puedes adjuntar archivos
no Puedes editar tus mensajes

El código vB está habilitado
Las caritas están habilitado
Código [IMG] está habilitado
Código HTML está deshabilitado
Saltar a Foro

Temas Similares
Tema Autor Foro Respuestas Último mensaje
como puedo ordenar y editar los datos de un listbox manu12345 OOP 9 19-05-2008 20:54:51
¿Puedo editar tema nuevo? jhonalone Internet 5 10-09-2007 20:34:42
No puedo borrar del stringGrid una fila que afecte en un registro. Arturo Varios 0 19-10-2006 19:07:15
No puedo EDITAR FASTREPORT en modo ejecucion. Tavi Impresión 0 21-09-2005 13:35:15
stringgrid , puedo recibir valores ? martita OOP 2 04-07-2005 19:21:03


La franja horaria es GMT +2. Ahora son las 18:42:44.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi
Copyright 1996-2007 Club Delphi