示例#1
0
        /// <summary>
        /// Creates the hyperlink column.
        /// </summary>
        /// <param name="prop">The prop.</param>
        /// <param name="dataItem">The data item.</param>
        /// <param name="column">The column.</param>
        /// <returns></returns>
        private TableCell CreateHyperlinkColumn(PropertyDescriptor prop, object dataItem, HyperlinkColumn column)
        {
            string strNavigationUrl = prop.GetValue(dataItem).ToString();

            strNavigationUrl = String.Format(column.NavigationUrlFormatString, strNavigationUrl);
            strNavigationUrl = this.ResolveClientUrl(strNavigationUrl);

            HyperLink a = new HyperLink()
            {
                Text = prop.GetValue(dataItem).ToString()
            };

            a.NavigateUrl = strNavigationUrl;
            a.Target      = column.Target;

            TableCell cell = new TableCell();

            cell.Controls.Add(a);

            if (column.Width.HasValue)
            {
                cell.Width = column.Width.Value;
            }

            return(cell);
        }
示例#2
0
        /// <summary>
        /// Creates the hyperlink column.
        /// </summary>
        /// <param name="prop">The prop.</param>
        /// <param name="dataItem">The data item.</param>
        /// <param name="column">The column.</param>
        /// <returns></returns>
        private TableCell CreateHyperlinkColumn(PropertyDescriptor prop, object dataItem, HyperlinkColumn column)
        {
            string strNavigationUrl = prop.GetValue(dataItem).ToString();
            strNavigationUrl = String.Format(column.NavigationUrlFormatString, strNavigationUrl);
            strNavigationUrl = this.ResolveClientUrl(strNavigationUrl);

            HyperLink a = new HyperLink() { Text = prop.GetValue(dataItem).ToString() };
            a.NavigateUrl = strNavigationUrl;
            a.Target = column.Target;

            TableCell cell = new TableCell();
            cell.Controls.Add(a);

            if (column.Width.HasValue)
            {
                cell.Width = column.Width.Value;
            }

            return cell;
        }