Search code examples
javascriptgridviewspgridview

SPGridView Field - javascript:window.open issue


I have an issue where in the SPGridView if I add a hyperlink field or anything, it seems like the javascript:window.open does not work. It does not show as a hyperlink.

Any advice?


Solution

  • I was able to resolve this one myself:

            BoundField colCaseTitle = new BoundField();
            colCaseTitle.ItemStyle.Width = Unit.Pixel(200);
            colCaseTitle.DataField = "CaseTitleModal";
            colCaseTitle.HeaderText = "Title";
            colCaseTitle.SortExpression = "CaseTitle";
            **colCaseTitle.HtmlEncode = false;**
            dataFilterList += ",";
            this.spGridView.Columns.Add(colCaseTitle);
    

    Also added this to my class that I am binding with:

    return "" + CaseTitle + "";