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
- Always Maximize
by 3m8ooo in Hal umum tentang Pascal Indonesia more 16 years ago - Ask: About mySQL tools ?
by cyber_hecker in MySQL more 19 years ago - tanya eror matrix
by diandewi in Hal umum tentang Pascal Indonesia more 12 years ago - Need 4 Help (About Multiple Thread )
by Starboard in Tip n Trik Pemrograman more 19 years ago - Tanya Tentang Thread, mengapa bisa hang
by danieljun in Tip n Trik Pemrograman more 17 years ago - Batasin angka di belakang koma
by adhiet_cool7 in Hal umum tentang Pascal Indonesia more 16 years ago - File Notepad
by Yudho in Hal umum tentang Pascal Indonesia more 18 years ago - Setup Dependencies.
by langithitam in Tip n Trik Pemrograman more 17 years ago - Gimana sih coding dengan touch screen ???
by EkoIndri in Enginering more 19 years ago - Append / Edit Table via Jaringan
by Thunder in Tip n Trik Pemrograman more 15 years ago