0

I using Delphi BDS 2006 and have a DevExpress cxGridDBColumn with properties set to DateEdit and was wondering whether it is possible to add a checkbox to the displayed date time picker popup?

PDM
  • 503
  • 2
  • 12
  • 27

2 Answers2

2

I am not sure that I understand what you wish to achieve. Anyway, it is impossible without creating a custom cxEditor which supports this look&feel and desired functionality.

DevExpress Team
  • 11,338
  • 2
  • 24
  • 23
  • Hi, what I want to achieve it to have a cxGrid where one of the columns uses a date selector (DateEdit). I want the usual calendar drop down to be displayed but at the bottom have an embedded checkbox. – PDM Sep 22 '10 at 08:40
  • Here is a quick hack which should help you: procedure TForm1.cxDateEdit1PropertiesPopup(Sender: TObject); var AEdit: TcxDateEdit; ACalendar: TcxPopupCalendar; ACheckBox: TcxCheckBox; begin AEdit := TcxDateEdit(Sender); if AEdit.Tag <> 1 then begin AEdit.Tag := 1; ACalendar := TcxPopupCalendar(AEdit.Properties.PopupControl); ACheckBox := TcxCheckBox.Create(Self); ACheckBox.Parent := ACalendar.Parent; ACheckBox.Align := alBottom; ACheckBox.Transparent := True; ACalendar.Parent.Height := ACalendar.Parent.Height + ACheckBox.Height; end; end; – DevExpress Team Sep 22 '10 at 09:23
0

Here is a quick hack which should help you implement this feature. However, you should handle the checkBox yourself. I have done this for the standalone editor, however, the same approach will work with the inplace editor:

procedure TForm1.cxDateEdit1PropertiesPopup(Sender: TObject);
var
  AEdit: TcxDateEdit;
  ACalendar: TcxPopupCalendar;
  ACheckBox: TcxCheckBox;
begin
  AEdit := TcxDateEdit(Sender);
  if AEdit.Tag <> 1 then
  begin
    AEdit.Tag := 1;
    ACalendar := TcxPopupCalendar(AEdit.Properties.PopupControl);
    ACheckBox := TcxCheckBox.Create(Self);
    ACheckBox.Parent := ACalendar.Parent;
    ACheckBox.Align := alBottom;
    ACheckBox.Transparent := True;
    ACalendar.Parent.Height := ACalendar.Parent.Height + ACheckBox.Height;
  end;
end;
DevExpress Team
  • 11,338
  • 2
  • 24
  • 23