Subject | TIB_Grid InPlaceEditor Logic |
---|---|
Author | Russell Belding |
Post date | 2002-01-04T08:50:09Z |
Hello IBO team
Using IBO 4.2Fn with D6.
In a TIB_Grid I have defined an in place editor for date fields by assigning
a procedure to the OnEditButtonClick Event. When my user clicks the editor
button my date editor appears. When it is
removed the TDatePick date editor then appears. This "double editing" does
not happen with Text fields unless EditLinksAuto is true.
To prevent double editing of date fields I have added the capitalised two
words below. The modified logic works for my purpose. Is it the best way to
handle the topic?
The relevant code is in IB_GRID.PAS:
procedure TIB_CustomGrid.EditButtonClick;
begin
if Assigned( InPlaceEditor ) and InPlaceEditor.Modified then
SysUpdateData( nil );
if Assigned( FOnEditButtonClick ) then
FOnEditButtonClick( Self )
else
if ( FEditLinksAuto and SelectedField.IsText ) then
ShowMemoEditor;
if Assigned( InPlaceEditor ) and FEDITLINKSAUTO AND
(( InPlaceEditor as TIB_GridInplaceEdit).EditStyle = esDate ) then
begin
... // do date editing using a TDatePick
end;
end;
Regards
Russell Belding
Using IBO 4.2Fn with D6.
In a TIB_Grid I have defined an in place editor for date fields by assigning
a procedure to the OnEditButtonClick Event. When my user clicks the editor
button my date editor appears. When it is
removed the TDatePick date editor then appears. This "double editing" does
not happen with Text fields unless EditLinksAuto is true.
To prevent double editing of date fields I have added the capitalised two
words below. The modified logic works for my purpose. Is it the best way to
handle the topic?
The relevant code is in IB_GRID.PAS:
procedure TIB_CustomGrid.EditButtonClick;
begin
if Assigned( InPlaceEditor ) and InPlaceEditor.Modified then
SysUpdateData( nil );
if Assigned( FOnEditButtonClick ) then
FOnEditButtonClick( Self )
else
if ( FEditLinksAuto and SelectedField.IsText ) then
ShowMemoEditor;
if Assigned( InPlaceEditor ) and FEDITLINKSAUTO AND
(( InPlaceEditor as TIB_GridInplaceEdit).EditStyle = esDate ) then
begin
... // do date editing using a TDatePick
end;
end;
Regards
Russell Belding