Questions about Delphi visual component DBGrid might have this tag.
Questions tagged [dbgrid]
251 questions
5
votes
4 answers
Delphi - restore actual row in DBGrid
D6 prof.
Formerly we used DBISAM and DBISAMTable. That handle the RecNo, and it is working good with modifications (Delete, edit, etc).
Now we replaced with ElevateDB, that don't handle RecNo, and many times we use Queries, not Tables.
Query must…

durumdara
- 3,411
- 4
- 43
- 71
5
votes
0 answers
Calling the OnDrawColumnCell procedure Delphi DBGrid
I have DBGrid which stores client information and the expiry dates of memberships. I am using the following code on the OnDrawColumnCell event of the DBGrid to color rows which include memberships which are expiring (teal) or expired…

Turtle254
- 115
- 3
- 9
5
votes
6 answers
DBGrid get selected cell
I need to get the value of the selected cell of a DBGrid in Delphi.
I have no idea how to do it. I tried dbGrid's OnMouseMove
pt : TGridCoord;
...
pt:=dbGrid.MouseCoord(x, y);
[Edited]
I can use the OnCellClick to get the value of the cell with…

Remus Rigo
- 1,454
- 8
- 34
- 60
5
votes
1 answer
delphi: how can I put Image in DBGrid Title?
How can I put Image in TDBGrid column heading?
I tried, but the image kept showing and kept disappearing when i put the mouse over the title.
procedure TForm1.DBGrid1DrawColumnCell(Sender: TObject; const Rect: TRect;
DataCol: Integer; Column:…

ABDNET
- 121
- 2
- 6
5
votes
3 answers
Select row after refreshing DBGrid
Well, some kind of n00b question from me. I've surfed the net and similar questions here but haven't found any right answers for such simple (as I thought) problem.
I have a DBGrid. I select one row and make some actions with another data linked to…

Vlad
- 337
- 1
- 7
- 12
4
votes
1 answer
Delphi: DBGrid Options are not saved?
I have my own DBGrid, based on TDBGrid.
In many places it is better to see the selection, so I thought to set it on Create, and the property editor saves the Options property if I set it as False later.
So constructor create it as:
constructor…

durumdara
- 3,411
- 4
- 43
- 71
4
votes
1 answer
Add DBLookupCombobox to Delphi DBGrid
I'd like to add DBLookupComboboxes to certain columns in a DBGrid. There is a nice article on About.com on how to do this here. The problem is that with a table having many columns, if you select from the DBLookupCombobox in one column and then try…

fullerm
- 406
- 1
- 8
- 23
4
votes
1 answer
How to get the value that caused the TDBGridInplaceEdit error?
I'm trying to write an exception handler that displays user friendly messages. I don't know how to get the "Newly Entered" data value that caused the TDBGridInplaceEdit error.
For example:
I have a DBGrid loaded with data. When I intentionally…

Michael Riley - AKA Gunny
- 5,074
- 4
- 42
- 89
4
votes
1 answer
Change DBGRID row color on field value in delphi
How to change color of dbgrid rows that have the same value on a field in delphi?
for example all rows that have the same teacher
note: those rows are grouped, and come after each other in dbgrid
thanks in advance

teocka
- 127
- 1
- 1
- 8
4
votes
3 answers
How to display TIMEDIFF(now, then) in a DB Grid?
Sorry, I am very new to DbGrids.
Should I use the query's field editor and somehow add a new field that captures the TIMEDIFF and then just add that as a column in my DbGrid?
Or can/should I skip the field editor and somehow declare the TIMEDIFFF as…

Mawg says reinstate Monica
- 38,334
- 103
- 306
- 551
4
votes
8 answers
Sort DBGrid by clicking column's title
Well, this seems a little tricky (if not imposible). I'm trying to make my DBGrid sort its data by clicking on column's title.
The thing is that I'm (sadly) working with Delphi 3, I'm not using ADO DataSets and the query gets a lot of rows, thus I…

Eliseo Ocampos
- 2,473
- 4
- 20
- 32
3
votes
1 answer
dbgrid autofit to a form
I have used DBGrid in BDS 2006.It has 6 columns which are populated during runtime.
The datatype for for one column is char(150) in mysql database. since while retriving from database to dbgrid it takes the length and the columns become wider with…
user1071339
3
votes
3 answers
DBGrid with read ahead capability using ADO
I'm working with ADO connecting to SQL Server 2005.
My TADODataSet selects 1 million records. using a TDBGrid and setting the TADODataSet.CursorLocation to clUseServer works. but the TDBGrid chokes!
How can I select 1 million records, avoid paging,…

kobik
- 21,001
- 4
- 61
- 121
3
votes
3 answers
Best DB grid to use with lots of lookup fields
I have a table with a couple foreign keys, something like this:
CREATE TABLE project.gl(
id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
glaccount_id INT(11) UNSIGNED NOT NULL,
project_id INT(11) UNSIGNED NOT NULL,
booking_id INT(11)…

Johan
- 74,508
- 24
- 191
- 319
3
votes
1 answer
Delphi: DBGrid Column Title Hint - force to reset the hint?
I thought that I implement column title hint into my own DBGrid.
It's seems to be simple - I thought.
I added
TitleHints : TStrings
that contains information in this format:
name=value
Where name is (0-99) for non-field-based columns, and fieldname…

durumdara
- 3,411
- 4
- 43
- 71