コード例 #1
0
        private void AddCustomCell(TableGridRow row, TableGridColumn.FormType formType, string idPrefix, string propertyName, string text)
        {
            TableGridColumn column = new TableGridColumn();

            column.ColumnType = formType;
            Label label = new Label();

            label.ID   = idPrefix + propertyName;
            label.Text = Server.HtmlEncode(text);
            column.Controls.Add(label);
            row.Cells.Add(column);
        }
コード例 #2
0
        private void AddCustomUrlCell(TableGridRow row, TableGridColumn.FormType formType, string idPrefix, string propertyName, string text)
        {
            TableGridColumn column = new TableGridColumn();

            column.ColumnType = formType;
            if (string.IsNullOrEmpty(text) == false)
            {
                HyperLink link = new HyperLink();
                link.ID   = idPrefix + propertyName;
                link.Text = Server.HtmlEncode(text);
                try
                {
                    link.NavigateUrl = Uri.EscapeUriString(text);
                }
                catch (UriFormatException)
                {
                    // Invalid url
                }

                column.Controls.Add(link);
            }
            row.Cells.Add(column);
        }