Column header hints were requested in DS2175. I am not sure if any progress been made towards a release date. In the meantime I have followed the suggestions in CQ37390 to implement column header hints in a GridDBTableView in the MouseMove event. This solution works well in some circumstances but not in all. The solution does not work when the column in question is too narrow to fully display the GridDBColumn's Caption. In that case my hint text is not displayed. The hint instead displays the caption for the column. (I believe this is the default behaviour). How can I prevent the column caption displaying in the hint, and have my hint text displayed instead please?
Here is my OnMouseMove code:
procedure TfrmInput.tvControlsMouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer);
var
AHitTest: TcxCustomGridHitTest;
AHint: string;
AColumn: TcxGridColumn;
begin
if not Assigned(Sender) then exit;
if not (Sender is TcxGridSite) then exit;
//determine the current mouse position
AHitTest := TcxGridSite(Sender).ViewInfo.GetHitTest(X, Y);
//hide displayed hint if mouse is not over a grid header
if AHitTest.HitTestCode <> htColumnHeader then
begin
tmrHint.Enabled := False;
TcxCustomHintStyleController(cxHintStyleController1).HideHint;
Exit;
end;
if AHitTest.HitTestCode = htColumnHeader then
with TcxGridColumnHeaderHitTest(AHitTest) do
begin
{check the current column over which the mouse is placed}
AColumn := Column;
if TcxGridDBColumn(AColumn).DataBinding.FieldName = 'AudTxt2' then
AHint := 'Audit2: description of the test performed by the audit team';
if (FColumn <> Column) or not FHintDisplayed then
begin
//redisplay hint window is mouse has been moved to a new cell
cxHintStyleController1.HideHint;
tmrHint.Enabled := False;
{store the current column}
FColumn := Column;
{obtain the current cell display text}
//AHint := cxGrid1DBTableView2.DataController.DisplayTexts[GridRecord.RecordIndex, Item.Index];
with tvControls.Site.ClientToScreen(Point(X, Y)) do
begin
FHintDisplayed := True;
{show hint}
cxHintStyleController1.ShowHint(X, Y, '', AHint);
end;
{start the hide hint timer}
tmrHint.Enabled := True;
end;
end;
end;
Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.
Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.
Hi Andy,
Please disable the GridView.OptionsBehavior.ColumnHeaderHints option. This should help you resolve the problem. For more information, please refer to the "TcxGridTableOptionsBehavior.ColumnHeaderHints" topic in the ExpressQuantumGrid's help.
Thanks,
Vito
Thanks for that, just what I needed to know.
Andy.