dbgrid

Are there any good free/cheap Delphi grid controls?

冷暖自知 提交于 2019-12-03 00:48:46
I gave up on Delphi's DBGrid nearly a decade ago because it is simply no good. Since then, I have used Virtual TreeView which offers a lot of value but it has a few issues. Like the current state of development (e.g. None) and the fact that there is no good data-bound version. DevExpress's QuantumGrid is famous for the rich feature set but is really quite expensive. I reckon that its huge feature set is probably overkill for 95% of the general use cases for data-bound grid controls. Does anyone know of a data-bound grid control that sports the following features: Checkboxes for boolean fields.

Delphi DBGrid Format Display Values

别来无恙 提交于 2019-12-02 01:05:50
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 Eduardo Mauro Each Field in your DataSet has two events: OnGetText and OnSetText. Use event OnGetText of desired fields and use Format function to format the value using a mask. you can use the DisplayFormat property of the field to format. check this sample TFloatField(YourDataSet.FieldByName('field')).DisplayFormat := '#,##0.00'; 来源: https://stackoverflow.com/questions/3619835/delphi-dbgrid-format-display-values

Setting a DBGrid column format in Delphi

时间秒杀一切 提交于 2019-12-01 17:39:27
I am using a DBGrid component in Delphi. I wonder how I can set the format of a column. I have real values that I want to be displayed as currency in the grid. Someone knows how? Germán Estévez -Neftalí- You can set the DisplayFormat of the Field You can handle OnGetText event. This approach allows to do more complex operations with the value. If you don't add the fields to field Editor list you can get the formating by code as : TFloatField(MyQuery.fieldByName('MyField').DisplayFormat := '0.00'; if you don't want to show the zeros replace '0.00' with '#.##'; The first port of call is the

Setting a DBGrid column format in Delphi

最后都变了- 提交于 2019-12-01 17:29:19
问题 I am using a DBGrid component in Delphi. I wonder how I can set the format of a column. I have real values that I want to be displayed as currency in the grid. Someone knows how? 回答1: You can set the DisplayFormat of the Field You can handle OnGetText event. This approach allows to do more complex operations with the value. 回答2: If you don't add the fields to field Editor list you can get the formating by code as : TFloatField(MyQuery.fieldByName('MyField').DisplayFormat := '0.00'; if you don

Delphi - restore actual row in DBGrid

醉酒当歌 提交于 2019-11-30 15:37:27
问题 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 reopen to see the modifications. But if we Reopen the Query, we need to repositioning to the last record. Locate isn't enough, because Grid is show it in another Row. This is very disturbing thing, because after the modification record is moving into

Delphi - restore actual row in DBGrid

爷,独闯天下 提交于 2019-11-30 15:05:44
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 reopen to see the modifications. But if we Reopen the Query, we need to repositioning to the last record. Locate isn't enough, because Grid is show it in another Row. This is very disturbing thing, because after the modification record is moving into another row, you hard to follow it, and users hate this. We found this code: function TBaseDBGrid

View position in DBGrid when scrolling in Delphi

走远了吗. 提交于 2019-11-29 16:52:36
I have a DBGrid on a form. The DBGrid has many columns, so an horizontal scroller is displayed. I scroll the DBGrid view to the right to see more columns. If I select a row, the DBGrid view is automatically reset to view the first column (As if I scroll back to the left most position). Is there a way to prevent that? I assume you have goRowSelect in the grid options. This forces the selected col to be the first non-fixed column, so whenever the row changes the code to scroll the selected cell into view forces the first non-fixed column to be visible. Since goRowSelect also effectively disables

How to find the actual width of grid component with scrollbar in Delphi

寵の児 提交于 2019-11-29 12:39:25
I have a grid component (DBGrid) which has lots of columns on it. Because of large number of columns, a scrollbar was created, and thus some part of grid remains hidden. I need to find out what is the real width of DBGrid, including the part which is not shown due to scroll bar. But Width property gives only the width of the component itself. Anybody has any idea? Perhaps this may be helpful. It is part of a class helper for TDBGrid that auto sizes the last column, so that the grid has no empty space. Should be easy to adjust to your needs. As you may notice, the CalcDrawInfo method is what

View position in DBGrid when scrolling in Delphi

点点圈 提交于 2019-11-28 11:30:53
问题 I have a DBGrid on a form. The DBGrid has many columns, so an horizontal scroller is displayed. I scroll the DBGrid view to the right to see more columns. If I select a row, the DBGrid view is automatically reset to view the first column (As if I scroll back to the left most position). Is there a way to prevent that? 回答1: I assume you have goRowSelect in the grid options. This forces the selected col to be the first non-fixed column, so whenever the row changes the code to scroll the selected

Adjust Column width DBGrid

跟風遠走 提交于 2019-11-28 01:06:54
I have a TDBGrid. It works, but the columns shown are very large. How can I set an "auto-fix column width"? The needed Columnwidth is depended of the settings of the Grids canvas and the mamimum length of the displaytext of each field. procedure FitGrid(Grid: TDBGrid); const C_Add=3; var ds: TDataSet; bm: TBookmark; i: Integer; w: Integer; a: Array of Integer; begin ds := Grid.DataSource.DataSet; if Assigned(ds) then begin ds.DisableControls; bm := ds.GetBookmark; try ds.First; SetLength(a, Grid.Columns.Count); while not ds.Eof do begin for I := 0 to Grid.Columns.Count - 1 do begin if Assigned