DataGrid loses view state if first column is a template column.

Discussion in 'ASP .Net' started by Ken Varn, Aug 18, 2005.

  1. Ken Varn

    Ken Varn Guest

    I have a problem where my DataGrid would not maintain the ViewState of my
    databound rows. I finally narrowed down the problem. If my first column is
    a template column, the view state for the DataGrid items is not maintained
    on postback for some reason.

    I basically re-created my DataGrid again just to make sure this was indeed
    the problem. The ViewState was fine until I added the template column at
    the beginning of the Columns list. After that, no more items in the
    ViewState on postback.

    Could someone explain if this is a known problem and how to fix it?

    --
    -----------------------------------
    Ken Varn
    Senior Software Engineer
    Diebold Inc.

    EmailID = varnk
    Domain = Diebold.com
    -----------------------------------
     
    Ken Varn, Aug 18, 2005
    #1
    1. Advertising

  2. Ken Varn

    Ken Varn Guest

    Update on DataGrid loses view state if first column is a template column.

    Here is an update on this problem. The datagrid has a mixture of bound and
    unbound items.

    If I add any unbound template items that are server side form controls, such
    as checkbox, button, etc.. to the DataGrid, the DataGrid will not maintain
    the view state of the bound items on postback. Thus, I lose all of the
    datagrid contents when I postback. What gives?

    --
    -----------------------------------
    Ken Varn
    Senior Software Engineer
    Diebold Inc.

    EmailID = varnk
    Domain = Diebold.com
    -----------------------------------
    "Ken Varn" <nospam> wrote in message
    news:%...
    > I have a problem where my DataGrid would not maintain the ViewState of my
    > databound rows. I finally narrowed down the problem. If my first column

    is
    > a template column, the view state for the DataGrid items is not maintained
    > on postback for some reason.
    >
    > I basically re-created my DataGrid again just to make sure this was indeed
    > the problem. The ViewState was fine until I added the template column at
    > the beginning of the Columns list. After that, no more items in the
    > ViewState on postback.
    >
    > Could someone explain if this is a known problem and how to fix it?
    >
    > --
    > -----------------------------------
    > Ken Varn
    > Senior Software Engineer
    > Diebold Inc.
    >
    > EmailID = varnk
    > Domain = Diebold.com
    > -----------------------------------
    >
    >
     
    Ken Varn, Aug 19, 2005
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    1
    Views:
    483
    Andy Fish
    Mar 15, 2005
  2. =?Utf-8?B?QnJpYW4=?=
    Replies:
    1
    Views:
    551
  3. Replies:
    0
    Views:
    724
  4. Bobby Edward
    Replies:
    5
    Views:
    452
    RayLopez99
    Mar 4, 2009
  5. Parthiv Joshi
    Replies:
    1
    Views:
    689
    Samuel L Matzen
    Jul 6, 2004
Loading...

Share This Page