Questions tagged [dbgrid]

Questions about Delphi visual component DBGrid might have this tag.

236 questions
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
  • 105
  • 3
  • 9
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
  • 307
  • 1
  • 7
  • 11
4
votes
2 answers

How to set active cell in TDBGrid?

I want to activate a cell in a TDBGrid by code. By "activate" I mean like the user clicked inside the cell, ready to edit the cell content. How could I do this? Edit: This probably involves two steps: change the currently active cell, then enter…
Heinrich Ulbricht
  • 9,107
  • 3
  • 45
  • 70
4
votes
1 answer

Delphi: DBGrid Options are not saved?

My problem is next: I have my own DBGrid, based on TDBGrid. Because in many places better to see the Selection, I thought I set it on Create, and the property editor save the Options property if I set it as False later. So constructor create it…
durumdara
  • 3,071
  • 4
  • 40
  • 66
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…
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
  • 34,839
  • 92
  • 281
  • 509
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
  • 20,439
  • 4
  • 54
  • 115
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
  • 71,222
  • 23
  • 174
  • 298
3
votes
1 answer

How do you Remove the Black Line from a Delphi DBGrid OnTitleClick Event?

I have a Delphi DBGrid that looks normal when it first loads. I have setup an OnTitleClick event that sorts the DBGrid by the column when the title is clicked. As soon as you click on the title, the column title acts like a button being pressed and…
3
votes
1 answer

How to detect user either in DBGrid or ClientDataset has deleted data in a cell at runtime?

I have a procedure that needs to be triggered/fired by a user deletion of data in a cell. Looks like ClientDataset.Delete is not appropriate for this case. My data structure are: TADOConnection -> TADOQuery -> TDataSetProvider -> TClientDataSet ->…
RickyBelmont
  • 477
  • 7
3
votes
1 answer

DBGrid - How to set an individual background color?

I am using Delphi 10.2.3 and want to change the background color of a DBgrid. For example I have a text column and an integer column. Depending on the text I want to change the color of the integer cell (in the same row) if the value is non-zero. I…
Jens
  • 337
  • 1
  • 10
3
votes
6 answers

Modify DBGrid cell content before it is displayed

I want to modify the content of a particular cell in dbgrid control when the database is loaded. For example, lets say I don't want any field of database to be displayed in dbgrid if it is equal to "forbidden". Is there any way that I can do that?
Azad Salahli
  • 887
  • 3
  • 12
  • 25
1
2
3
15 16