I am using TCRDBGrid which included in Mydac (5.10.0.9 for Delphi 7).
I have 3 problems with it:
1. Showing proper number of rows in grid
In TMyStoredProc I have:
FetchAll=False
Options: QueryRecCount=True
After opening TMyStoredProc, TCRDBGrid does not show number of records in status bar of the grid. There is only information f.e. "13/0". I found that if I am using TMyQuery everything is OK (f.e. "13/129") but I prefer TMyStoredProc. Maybe I am doing something wrong. Can somebody help me?
2. Popup menu in TCRDBGrid
I wanted to switch off the standard popup menu in the TCRDBGrid component. I found it possible only when switching off the option "dgIndicator" but then I am also loosing indicators I wanted to have. Maybe somebody had similar problem?
3. Sorting rows in TCRDBGrid
In TMyStoredProc when I have FetchAll=False and click the name of the column for sorting it - only rows loaded to the grid (f.e. 25) are sorted. When after it I am moving in grid and it loads next rows they are completly not sorted. Has everyone such problem ?
Thank you in advance for any help.
TCRDBGrid - some problems
1) TMyQuery has access to the text of the query that returns records, so it can modify the query so that it returns total record count. For example, this query: is converted to this one:
The TMyStoredProc component has no such possibility. This is the reason of such behaviour.
2)
You can do this in following ways:
- change code of the TCRDBGrid.IndicatorClick method in the CRGrid.pas unit to disable this menu. Note this unit is not included in MyDAC Trial Edition;
- create a mew menu instance and assign the TCRDBGrid.OptionsMenu property with it:
3)
I could not reproduce this problem. Applying order to TCRDBGrid leads to assigning the IndexFieldsNames of attached dataset if it is possible. This will force fetching all records. Please provide more detailed description of this problem, or send me a complete small sample at evgeniyD*crlab*com to demonstrate it, including script to create server objects.
Code: Select all
SELECT * FROM Emp Code: Select all
SELECT COUNT(*) FROM Emp2)
You can do this in following ways:
- change code of the TCRDBGrid.IndicatorClick method in the CRGrid.pas unit to disable this menu. Note this unit is not included in MyDAC Trial Edition;
- create a mew menu instance and assign the TCRDBGrid.OptionsMenu property with it:
Code: Select all
CRDBGrid.OptionsMenu := TPopupMenu.Create(nil);I could not reproduce this problem. Applying order to TCRDBGrid leads to assigning the IndexFieldsNames of attached dataset if it is possible. This will force fetching all records. Please provide more detailed description of this problem, or send me a complete small sample at evgeniyD*crlab*com to demonstrate it, including script to create server objects.