Subject TIB_GridInplaceEdit
Author guido.klapperich@t-online.de
I have written my own calendar-component, that should appear, when the
user clicks on a date-field in a grid. Therefore I have a new class
TIP_Grid derived from TIB_Grid. But I have some problems in the
EditButtonClick-Procedure of my class.

This was my first try:
procedure TIP_Grid.EditButtonClick;
begin
....
if Assigned( InPlaceEditor ) and
((InPlaceEditor as TIB_GridInplaceEdit).EditStyle = esDate) then
begin
FKalender := TIP_Calendar.Create( Self );
FKalender.OnChange := KalenderChange;
fKalender.FirstWeek:=ffirstweek;
...
end;

But it doesn't work, because EditStyle is protected in
TIB_GridInplaceEdit, so I created a new class
TIP_GridInplaceEdit = class(TIB_GridInplaceEdit)
published
property EditStyle;
end;

And this was my second try:
procedure TIP_Grid.EditButtonClick;
begin
....
if Assigned( InPlaceEditor ) and
((InPlaceEditor as TIP_GridInplaceEdit).EditStyle = esDate) then
begin
FKalender := TIP_Calendar.Create( Self );
FKalender.OnChange := KalenderChange;
fKalender.FirstWeek:=ffirstweek;
...
end;

This was ok for the compiler, but when I do something in the
OnEditButtonClick-Event of my IP_Grid, I get an 'invalid typcast'-error.

Can anybody help me ?


Guido.