AdvStringGrid Focusing Problem

Hi,

I am attempting to create a data entry grid, that has the editor always shown and am experiencing a problem with a the focusing on a grid first time into a form.


I have set up a AdvGrid as the first component on the form with the following properties

  Navigation.AlwaysEdit=true

  Navigation.EditSelectAll=true 
  Options.goEditing=true 



The result is that the first cell has the focus, but not in edit mode (i.e. the cell has not gone had a SelectAll on it .
The interesting thing I have noticed, is that if you focus to another
control on the form - and then back the grid does go into edit mode as
expected.



Any help would be appreciated

Thanks,

Nick.

Try to call grid.ShowInplaceEdit for example in the form's OnShow event.

Thanks for the reply Bruno,

but that seem to make any difference in how the editor worked. The cell is focused and editable - but not with the select all style display.

I can provide code samples if you need

Thanks again
Nick.

<!--if !mso>

v:* {behavior:url(#default#VML);}
o:* {behavior:url(#default#VML);}
w:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}



I retested this here with a default grid on the form with the code:

procedure TForm4.Button1Click(Sender: TObject);
begin
  advstringgrid1.SetFocus;
  advstringgrid1.ShowInplaceEdit;
end;

procedure TForm4.FormCreate(Sender: TObject);
begin
  advstringgrid1.LinearFill;
  advstringgrid1.Options := advstringgrid1.Options + [goEditing];
  AdvStringGrid1.Navigation.EditSelectAll := true;
  AdvStringGrid1.Navigation.AlwaysEdit := true;
end;

and this does start the inplace editor with all cell text selected.

Thanks Bruuno, works a treat!