AdvGrid inplace editor edTimeEdit

Good aftrenoon to all,

in the cells grid i use inplace editor in order to input hours and minuted.



the inplace editor type is edTimeEditor and i set it as follow:



procedure TFCP.SG1GetEditorType(Sender: TObject; ACol, ARow: Integer;

var AEditor: TEditorType);

begin

if ACol>0 then

begin

    AEditor:=edTimeEdit;

    SG1.SpinEdit.ParentFont:=False;

    SG1.SpinEdit.Font.Size:=8;

    SG1.SpinEdit.Font.Color:=clBlack;

    SG1.SpinEdit.ShowSeconds:=False;

end;

end;



I have one problem ....

I'm not able to hide the seconds (even if i try with SG1.SpinEdit.ShowSeconds:=False;) and the spin button (i just want to type the hours and minutes).



There's a way to hide seconds and spin button ??



Thank's for all



Regards



Daniele

Hi to all again,

if the above procedure is changed as



procedure TFCP.SG1GetEditorType(Sender: TObject; ACol, ARow: Integer;

var AEditor: TEditorType);

begin

if ACol>0 then

begin

    AEditor:=edTimeEdit;

   // NEW



    if SG1.Times[ACol,ARow]=0 then

    begin

      SG1.SpinEdit.TimeValue:=EncodeTime(0,0,0,0);

    end;

// END NEW



    SG1.SpinEdit.ParentFont:=False;

    SG1.SpinEdit.Font.Size:=8;

    SG1.SpinEdit.Font.Color:=clBlack;

    SG1.SpinEdit.ShowSeconds:=False;

end;



end;



when double click on the cell there's an error as



'' is not a valid time



when click over ok button, this error message persist for 10-15 times befor close.



If the cell is empty (this mean the time is not assigned) the editor need to set to 00:00 and not to actual time (15:38:25)



Any suggestion ??



Thank's



Daniele

The edTimeEdit maps on grid.DateTimePicker.

To hide seconds, set:   grid.DateTimePicker.format := 'hh:mm';


There is currently not a built-in setting to hide the spin buttons. If you want a control without spin buttons, I'd suggest to consider a masked editor with a mask defined for hours:minutes

Good morning Bruno,

thank's for reply ...



Daniele