Arsip: combobox dalam dbgrid

more 16 years ago
abu_jauzaa
gimana ya caranya masukkan combox dlm dbgrid?,sori newbie,
udah nyari diforum tpi ndak ketemu

more 16 years ago
juandon
@abu_jauzaa mungkin sedikit coding in bisa membantu :
procedure TForm1.DBGrid1DrawColumnCell(Sender: TObject; const Rect: TRect;
DataCol: Integer; Column: TColumn; State: TGridDrawState);
begin
if (gdFocused in State) then
begin
FActiveField := column.Field;
if Column.Field.DataType in [ftDate, ftDateTime] then
with Datetimepicker1 do
begin
Left := Rect.Left + DBGrid1.Left + 1;
Top := Rect.Top + DBGrid1.Top + 1 ;
Width := Rect.Right - Rect.Left + 2;
Height := Rect.Bottom - Rect.Top + 2;
DateTime := Column.Field.AsDateTime;
Visible := True;
end;
end
end;
procedure TForm1.DBGrid1ColExit(Sender: TObject);
begin
if FActiveField.DataType in [ftDate, ftDateTime] then
Datetimepicker1.Visible := false;
end;
procedure TForm1.DBGrid1KeyPress(Sender: TObject; var Key: Char);
begin
if (key = chr(9)) then exit;
DBGrid1.DataSource.Edit;
if FActiveField.DataType in [ftDate, ftDateTime] then
begin
datetimepicker1.SetFocus;
SendMessage(Datetimepicker1.Handle, WM_Char, word(key), 0);
end;
end;
procedure TForm1.DateTimePicker1Change(Sender: TObject);
begin
if DBGrid1.DataSource.State in [dsEdit, dsInsert] then
FActiveField.Value := DatetimePicker1.DateTime;
end;
procedure TForm1.DateTimePicker1DropDown(Sender: TObject);
begin
DBGrid1.DataSource.Edit;
end;
procedure TForm1.ComboBox1DropDown(Sender: TObject);
begin
DBGrid1.DataSource.Edit;
end;
bisa download source langkapnya di :
hxxp://www.ziddu.com/download/2984733/dtpdalamdbgrid.rar.html
contohnya menggunakan date time picker klo mo combobox silahkan explorer sendiri kurang lebih sama.
more ...
- Pages:
- 1
reply |
Report Obsolete
AI Forward

🚀 We're thrilled to partner with Alibaba Cloud for "AI Forward - Alibaba Cloud Global Developer Summit 2025" in Jakarta! Join us and explore the future of AI. Register now:
https://int.alibabacloud.com/m/1000400772/
#AlibabaCloud #DeveloperSummit #Jakarta #AIFORWARD
Last Articles
Last Topic
- PascalTalk #6: (Podcast) Kuliah IT di luar negeri, susah gak sih?
by LuriDarmawan in Tutorial & Community Project more 4 years ago - PascalTalk #5: UX: Research, Design and Engineer
by LuriDarmawan in Tutorial & Community Project more 4 years ago - PascalTalk #4: Obrolan Ringan Seputar IT
by LuriDarmawan in Tutorial & Community Project more 4 years ago - PascalTalk #2: Membuat Sendiri SMART HOME
by LuriDarmawan in Tutorial & Community Project more 4 years ago - PascalTalk #3: RADically Fast and Easy Mobile Apps Development with Delphi
by LuriDarmawan in Tutorial & Community Project more 4 years ago - PascalTalk #1: Pemanfaatan Artificial Intelligence di Masa Covid-19
by LuriDarmawan in Tutorial & Community Project more 4 years ago - Tempat Latihan Posting
by LuriDarmawan in OOT more 5 years ago - Archive
- Looping lagi...
by idhiel in Hal umum tentang Pascal Indonesia more 12 years ago - [ask] koneksi ke ODBC user Dsn saat runtime dengan ado
by halimanh in FireBird more 12 years ago - Validasi menggunakan data tanggal
by mas_kofa in Hal umum tentang Pascal Indonesia more 12 years ago
Random Topic
- gimana auto install delphi vcl package
by triasfahrudin in Tutorial & Community Project more 16 years ago - menghapus Format Rupiah(Rp) DiDBEedit
by saysansay in Enginering more 19 years ago - Instalshield DevStudio
by reza_elka in Tip n Trik Pemrograman more 13 years ago - Kirim SMS lebih dari 1
by rusteten in Tip n Trik Pemrograman more 17 years ago - Koneksi MS SQL Server antara daerah...
by awonk in Hal umum tentang Pascal Indonesia more 18 years ago - Bagaimana Cara Merubahn Jam ke menit
by ari_volker in Tip n Trik Pemrograman more 17 years ago - Contoh aplikasi dari Procedure Rupiah ke Terbilang?
by gormet in Tip n Trik Pemrograman more 17 years ago - Cari j2sdk1.4.2_10 ?
by umarbakri in Hal umum tentang Pascal Indonesia more 18 years ago - program billing warnet
by slam in Tip n Trik Pemrograman more 17 years ago - Tentang Array
by telkom_1 in Tip n Trik Pemrograman more 17 years ago