Hello
I read several topics about HyperLink here but there is still bug (or by design behaviour?), because I can't use cxGridDBTableView.OptionsSelection.CellSelect:=false when I want to follow the link…
Is it true? If so, how can I achieve this behaviour via OnCellClick? It seems to me that this should be the way…
if ACellViewInfo.Properties.ClassName='TcxHyperLinkEditProperties' then …ShowHttp(ACellViewInfo.Value)
Thanks
Vladimir
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 Vladimir,
By design, a hyperlink is activated by a second click or double click in a cell. However, if the CellSelect option is disabled, a cell editor does not receive focus, and therefore the execution doesn't take place.
To implement the same behavior when the CellSelect option is disabled, handle the View's OnCellClick as follows:
procedure <Form>.<View>CellClick(Sender: TcxCustomGridTableView; ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton; AShift: TShiftState; var AHandled: Boolean); var ATextToExecute : String; begin if (ACellViewInfo.Properties.ClassName = 'TcxHyperLinkEditProperties') and ( AShift = []) then begin ATextToExecute := Trim(ACellViewInfo.DisplayValue); with (ACellViewInfo.Item.Properties as TcxHyperLinkEditProperties) do begin if UsePrefix <> upNever then ATextToExecute := Trim(Prefix + ATextToExecute); if ATextToExecute <> '' then ShellExecute(0, 'OPEN', PChar(ATextToExecute),nil, nil, SW_SHOWMAXIMIZED); end; end; end;
I hope this information will help you achieve the desired effect.
If you need any further assistance on this subject, please feel free to reactivate this ticket.
Thanks,
Dimitros