Add a link to DataGrid control

To add a functional link (i.e. Edit/Delete etc),:

  1. Add any columns to the grid.
  2. Change the type to Hyperlink.
  3. May toggle ‘Read-Only’ (since you don’t really want to change the value), but do NOT check ‘Disable Editor’  (otherwise the link event won’t be fired).
  4. Put the name of the link in Format String.  Make sure Format is not ftNone otherwise the FormatString will be ignored)
  5. Check “Single Click to Launch”
  6. Uncheck “Row Select” property for the grid, otherwise no OnEdit or OnHyperlinkStart event will fire. (Note: “Row Select” will automatically disable in-place editing. So if you don’t want in-place editing you need to toggle “ReadOnly”. With “ReadOnly”, the editor will still be invoked but values are not changable. )
  7. Handle OnHyperlinkStart Event

What happens is that when user clicks on that blue link, the text in that cell will turn to the original value of the bound field. As soon as the OnHyperlinkStart event returns, it will switch back to the format string you specify in Columns properties.

Advertisements
This entry was posted in SalesLogix. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s