MobileForms Toolkit Documentation

LinkCell Class

LinkCell is TextCell for displaying hyperlinks.

For a list of all members of this type, see LinkCell Members.

System.Object
   System.MarshalByRefObject
      System.ComponentModel.Component
         Resco.Controls.AdvancedTree.Cell
            Resco.Controls.AdvancedTree.TextCell
               Resco.Controls.AdvancedTree.LinkCell

public class LinkCell : TextCell

Thread Safety

Public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread-safe.

Remarks

The LinkCell is a TextCell capable of diplaying links. Link cells have different default ForeColor and TextFont, to get the look of the hyperlinks.

Links can fire the LinkClick event. During handling this event links change color to ActiveColor. After activation, link is marked as visited, and displayed with VisitedColor. The link state is determined from the target property, which can be indenpedent to displayed text, and is determined with the UrlFormatString property.

You can get different behavior with combination of using the CellSource, FormatString and UrlFormatString for the same data.

ScenarioHow to get it
Constant text / constant link, Target == Text You can use Constant source of data, with FormatString and UrlFormatString both {0}.
Any text / constant link, Target != Text You can use desired FormatString in conjuction with the source of data, and use constant UrlFormatString set to target (without {0} parameter), e.g. UrlFormatString = "OrderForm", when displaying product name as a text.
Constant text / various link, Target != Text You can use desired UrlFormatString in conjuction with the source of data, and use constant FormatString set to displayed text (without {0} parameter), e.g. FormatString = "Buy Now!", and target is set to product id).
Various text / various link, Target and Text bound to same source You can use desired UrlFormatString and FormatString in conjuction with the source of data, e.g. FormatString="{0}" and UrlFormatString = "mailto://{0}" as , when displaying e-mails.

The target of the link denotes the state of it, so when more combinations of LinkCells with data will have the same target, all will look visited after clicking on any of them.

Example

[Visual Basic]
      
' LinkCell1 is used to display the text "Help" and when clicked, 
' the Target of LinkClick event will be "Help" too
LinkCell1.CellSource.ConstantData = "Help"
LinkCell1.FormatString = "{0}"
LinkCell1.UrlFormatString = "{0}"

' LinkCell2 is used to display the product name and when clicked, 
' the Target of LinkClick event will be "OrderForm"
LinkCell2.CellSource.ColumnName = "ProductName"
LinkCell2.FormatString = "{0}"
LinkCell2.UrlFormatString = "OrderForm"

' All links displayed by the LinkCell1 or LinkCell2 will have the same target, 
' so they will all get VisitedColor after clicking on any of them.

' LinkCell3 is used to display the text "Buy now!" and when clicked, 
' the Target of LinkClick event will be set to product id
LinkCell3.CellSource.ColumnName = "ProductId"
LinkCell3.FormatString = "Buy now!"
LinkCell3.UrlFormatString = "{0}"

' LinkCell4 is used to display the email and when clicked, 
' the Target of LinkClick event will contain prefix "mailto://" for use in IE
LinkCell4.CellSource.ColumnName = "Email"
LinkCell4.FormatString = "{0}"
LinkCell4.UrlFormatString = "mailto://{0}"
            
    
[C#]
      
// linkCell1 is used to display the text "Help" and when clicked, 
// the Target of LinkClick event will be "Help" too
linkCell1.CellSource.ConstantData = "Help";
linkCell1.FormatString = "{0}";
linkCell1.UrlFormatString = "{0}";

// linkCell2 is used to display the product name and when clicked, 
// the Target of LinkClick event will be "OrderForm"
linkCell2.CellSource.ColumnName = "ProductName";
linkCell2.FormatString = "{0}";
linkCell2.UrlFormatString = "OrderForm";

// All links displayed by the LinkCell1 or LinkCell2 will have the same target, 
// so they will all get VisitedColor after clicking on any of them.

// linkCell3 is used to display the text "Buy now!" and when clicked, 
// the Target of LinkClick event will be set to product id
linkCell3.CellSource.ColumnName = "ProductId";
linkCell3.FormatString = "Buy now!";
linkCell3.UrlFormatString = "{0}";

// linkCell4 is used to display the email and when clicked, 
// the Target of LinkClick event will contain prefix "mailto://" for use in IE
linkCell4.CellSource.ColumnName = "Email";
linkCell4.FormatString = "{0}";
linkCell4.UrlFormatString = "mailto://{0}";
           
    

Requirements

Namespace: Resco.Controls.AdvancedTree

Assembly: Resco.AdvancedTree.CF3 (in Resco.AdvancedTree.CF3.dll)

See Also

LinkCell Members | Resco.Controls.AdvancedTree Namespace