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