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
1106
Header Templates - Programatic Access ( BUG ) ?????
posted

I want to be able to create my own info links in the header, so I created a Template called RiskLetter, this simply has a Hyperlink in it with a reference to http://www.microsoft.com in order to test. Fire it up and that works fine.

I want to programatically access this link and change its properties under certain conditions. So I tried this in both Page Load and in PreRender.

 

 

var headerLink = (HyperLink)WebHierarchicalDataGrid1.Columns[0].Header.TemplateContainer.FindControl("linkMicrosoft"

);

The effect of this simple assignment is as follows.

1.) The link fails to render.

2.) The var headerLink is null.

Any ideas. Ive tried to find this control through the IDE watch by looking at the object on the breakpoint before the assignment, but I cant find it.

Cheers

 

Parents
  • 2501
    Verified Answer
    posted

    Hello Soberly,

    Thank you for submitting your inquiry to the Infragistics ASP.Net forums.  To access a HyperLink in a WebHierarchicalDataGrid Column Header Template, add GridView to the path in the line of code you posted as demonstrated here:

             var headerLink = (HyperLink)WebHierarchicalDataGrid1.GridView.Columns[0].Header.TemplateContainer.FindControl("linkMicrosoft");

    The Columns on the WebHierarchicalDataGrid are defining the Band of which GridView is the only RowIsland.  The Template is only instantiated on the ContainerGrid or GridView.

    Please let me know if this information is helpful or if you require further assistance on this matter.

    Thank you.

    Sincerely,
    Mike D.
    Developer Support Engineer
    Infragistics
    www.infragistics.com/support

Reply Children
No Data