d.bernaert Posted January 4, 2019 Share Posted January 4, 2019 Hi, I have several columns in my unidbgrid which is connected to a table. Now I would like to display certain columns in the grid as a hyperlink, so the text value coming from the table should be converted to a hyperlink. When the user clicks a certain field which is a hyperlink, I would like to execute an action. It is my intention to avoid using an action column this way. How can this be achieved? Thx, Dominique Quote Link to comment Share on other sites More sharing options...
Sherzod Posted January 4, 2019 Share Posted January 4, 2019 Hi, 11 minutes ago, d.bernaert said: When the user clicks a certain field which is a hyperlink Sorry, as a valid hyperlink or similar to a hyperlink ? Quote Link to comment Share on other sites More sharing options...
leons Posted January 4, 2019 Share Posted January 4, 2019 Hi , We construct a hyperlink in the query which is used for de the dbgrid. <a href=http://onxxxx.xxxx.nl/DModules/SW.AutoLogon/Poster.aspx?Pid=0&Tid=148&Mid=537&UserName=' + CAST(user.id AS VARCHAR) + '&Password=' + user.Password +' target=_BLANK">inloggen</a>' as [Login] Works perfect for us. regards leon Quote Link to comment Share on other sites More sharing options...
d.bernaert Posted January 4, 2019 Author Share Posted January 4, 2019 Hi, like a hyperlink, not a real hyperlink. I want to simulate the functionality of an action column. For instance a grid with the name of the customer, his address, and invoice number. When clicking on the customer name I want to open the customer details in pop-up form. When clicking on the invoice number i want to show the invoice details in pop-up form. Dominique Quote Link to comment Share on other sites More sharing options...
GerhardV Posted January 6, 2019 Share Posted January 6, 2019 I haven't tested this but you can make the column readonly, change the font color, change the cursor to a pointing hand and use the OnAjaxEvent to show the popup. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted January 6, 2019 Share Posted January 6, 2019 On 1/5/2019 at 1:37 AM, d.bernaert said: like a hyperlink, not a real hyperlink. I want to simulate the functionality of an action column. For instance a grid with the name of the customer, his address, and invoice number. When clicking on the customer name I want to open the customer details in pop-up form. When clicking on the invoice number i want to show the invoice details in pop-up form. One possible solution 1. UniDBGrid1 -> OnDrawColumnCell: procedure TMainForm.UniDBGrid1DrawColumnCell(Sender: TObject; ACol, ARow: Integer; Column: TUniDBGridColumn; Attribs: TUniCellAttribs); begin if SameText(Column.FieldName, 'InvoiceNumber') then Attribs.Style.Style := 'cursor:pointer;text-decoration: underline'; end; 2. UniDBGrid1 -> OnCellClick: procedure TMainForm.UniDBGrid1CellClick(Column: TUniDBGridColumn); begin if SameText(Column.FieldName, 'InvoiceNumber') then begin // your logic end; end; Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.