Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
130
create ColumnHeader that is hyperlink
posted

I am trying to modify existing code that is similar to the following:

   ch = new ColumnHeader(false);
   ch.Caption = "Total Cost";
   ch.RowLayoutColumnInfo.OriginX = 8;
   ch.RowLayoutColumnInfo.OriginY = 0;
   e.Layout.Bands[0].HeaderLayout.Add(ch);

What I want to do is create a link so that when the "Total Cost" Header is clicked, another aspx page will open up.  Is there a way to do this?

Thanks!

 

Parents
  • 45049
    posted

    There are two options for this that I can think of.

    One is to handle the ColumnHeaderClick event of the grid, confirm that the header that was clicked is the one you want to respond to, and in there using window.open() to open up the new page.

    The other is to set the Caption of your grid to an HTML anchor tag, so that it's processed by the client as a hyperlink.  This will only work if the column's HTMLEncodeContent property is set to false, which it is by default.

     ch.Caption = "<a href='http://infragistics.com'>Total Cost</a>";

Reply Children