Questions tagged [dbgrid]

Questions about Delphi visual component DBGrid might have this tag.

236 questions
3
votes
2 answers

Calculated percentage in Delphi DBGrid

I'm maintaining a Delphi application since a few days. The customer wants to add a percentage column to a DBGrid, now showing a "Quantity" column. Of course the percentage would be the Row quantity / Total Quantity * 100 I cannot modify the…
Stefano Losi
  • 494
  • 6
  • 15
3
votes
1 answer

How to use bookmarks and DisableControls

Is it possible to do dataset.DisableControls Bookmark1 := dataset.Bookmark; { do someting............. } dataset.enableControls; dataset.Bookmark := Bookmark1; dataset.FreeBookmark(Bookmark1); Let say getting the total of a TDBGrig.
ml.
  • 163
  • 4
  • 14
3
votes
2 answers

DBGrid: how to prevent a row from being selected?

I have a grid of entries the user will click on to multi-select for a process. Some of the entries will be invalid based upon values of the first selected row. I know about DBGrid.SelectedRows.CurrentRowSelected, but I cannot find a suitable place…
José Eduardo
  • 313
  • 1
  • 4
  • 16
3
votes
2 answers

Delphi DBGrid Format Display Values

I need to format values in a DBGrid to display in a certain format ex '#,##0.00'. Any idea how to do that? Regards, Pieter
Pieter van Wyk
  • 2,268
  • 9
  • 41
  • 63
3
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
  • 320
  • 6
  • 19
3
votes
1 answer

How to add an image with transparency to a TDbgrid column in delphi?

I am trying to add an image to a column on a TDbgrid that takes transparency into account. When drawing the image from a TImageList on the canvas in the DBGridDrawColumnCell procedure, I need the background of the image (the same color as the pixel…
3
votes
1 answer

Insert DBGrid data into a multi-dimensional array

I have set a connection from Delphi to pgsql using ADOConnection, ADOQuery, DataSource and a DBGrid to present the results of my query. The database contains 2 columns of values of type double, of some thousands of rows, which I would like to…
Elena_K
  • 53
  • 7
3
votes
5 answers

Is there a DBGrid component that can handle large datasets fast?

Large datasets, millions of records, need special programming to maintain speed in DBGrids. I want to know if there are any ready-made components for Delphi (DBGrids) that do this automatically? EDIT For Example: Some databases have features such…
Johan Bresler
  • 6,079
  • 10
  • 53
  • 76
3
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,354
  • 7
  • 32
  • 56
3
votes
2 answers

How to manipulate the contents of a DB Grid before display?

I have a column in a DB table which stores pressure. The pressure is always stored as PSI and can be converted to BAR by diving by 14.5. The user can toggle display of PSI/BAR with a Radio Group. I was using a TStringGrid and am converting to a…
Mawg says reinstate Monica
  • 34,839
  • 92
  • 281
  • 509
3
votes
2 answers

DBGrid scroll page instead of row

Well I have an issue with DBGrid vertical scrolling. When I scroll it vertically with mousewheel or vertical scrollbar it moves selected row up and down. I want to make it scroll not selected row but entire grid. Just like it works in Microsoft…
Vlad
  • 307
  • 1
  • 7
  • 11
3
votes
7 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,242
  • 4
  • 17
  • 31
3
votes
1 answer

change dbgrid options at runtime

I want to change the DBGrid.Option.I found the following code: DBGrid.Options:=DBGrid.Options + [dgEditing]; DBGrid.Options:=[dgEditing]; But do not work properly and the error [dgEditing]. I want to enable or disable the [dgEditing],[dgRowSelect]…
HamiD
  • 187
  • 1
  • 2
  • 11
2
votes
3 answers

Disabling editing option on TDBGrid doesn't function

When creating TDBGrid components dynamically at runtime, i can't forbid user to edit values in cells. This is how I am trying to accomplish this type of behaviour: TDBGrid *DbGrid = new TDBGrid(Owner); DbGrid->Options = DbGrid->Options >>…
truthseeker
  • 1,122
  • 3
  • 21
  • 54
2
votes
2 answers

Delphi DBGrid formatting with MySQL

I have a question regarding formatting of data cells in the delphi DBGrid. The DBGrid component is connected to a MySQL database, which gets populated at run time. I have a column for DateTime and one for Boolean. When the time part of the datetime…
Erik
  • 117
  • 9
1 2
3
15 16