teemukeiski.net

Teemu Keiski's .NET site
Welcome to teemukeiski.net Sign in | Join | Help
in
Home Our Blogs BlogRoll Forums Photos Downloads

Strange Problem: Templated checkbox column

Last post 07-10-2007, 18:51 by joteke. 1 replies.
Sort Posts: Previous Next
  •  05-06-2007, 7:19 151

    Strange Problem: Templated checkbox column

    Hi,

    I've coded a templated column that will add a column of asp:Checkboxes
    including an asp:checkbox on the column header, to a gridview. The checkbox
    on the column header has Auto-postingback enabled and I've added an event
    hanlder to handle the CheckChanged event. I've put some code to the
    CheckChanged event hanlder. The templated column column is very simple
    doesnt do anything other than mentioned above.

    If I add this templated column on fly to a gridview which is also built
    dynamically, then CheckChanged event handlder fires when I tick/untick the
    column header checkbox, so no problem.

    But if I add this templated column on fly to a gridview added to the page in
    the designmode, then CheckChanged event handler fires only when I tick the
    checkbox on the column header. Event hanlder is not called when I untick the
    checkbox.

    Anybody know reason to this behavior? How to change this behavior?

    Dev

  •  07-10-2007, 18:51 160 in reply to 151

    Re: Strange Problem: Templated checkbox column

    Make sure you add the column, as you add it dynamically, in Page_Load at the latest.
    Thanks,

    Teemu Keiski
    AspInsider, ASP.NET MVP
View as RSS news feed in XML