Datagrid Viewstate not working correctly?

Discussion in 'ASP .Net' started by Nomen Nescio, Feb 7, 2007.

  1. Nomen Nescio

    Nomen Nescio Guest

    Hi,

    I have a Datagrid with template columns (TextBox and Radiolist in them).
    When I type something in the textbox and push a radiobutton and
    subsequently push another button (not part of the datagrid) the contents
    isn't restored on the round-trip, even though the Viewstate for the
    Datagrid and the controls is set to 'true'.

    Anyone have a clue what the problem could be? Someone told me there are
    'problems' with the Viewstate in the Datagrid but from what I gather from
    the documentation it should just work.

    Thanks in advance
     
    Nomen Nescio, Feb 7, 2007
    #1
    1. Advertising

  2. Morning,

    It's desired behaviour. If you want reset controls to their initial state
    rebind the data.

    --
    Milosz


    "Nomen Nescio" wrote:

    >
    > Hi,
    >
    > I have a Datagrid with template columns (TextBox and Radiolist in them).
    > When I type something in the textbox and push a radiobutton and
    > subsequently push another button (not part of the datagrid) the contents
    > isn't restored on the round-trip, even though the Viewstate for the
    > Datagrid and the controls is set to 'true'.
    >
    > Anyone have a clue what the problem could be? Someone told me there are
    > 'problems' with the Viewstate in the Datagrid but from what I gather from
    > the documentation it should just work.
    >
    > Thanks in advance
    >
    >
    >
     
    =?Utf-8?B?TWlsb3N6IFNrYWxlY2tpIFtNQ0FEXQ==?=, Feb 7, 2007
    #2
    1. Advertising

  3. Sorry, I found the problem here:

    http://msdn2.microsoft.com/en-us/library/aa478966.aspx

    "Forgetting to Check for IsPostBack in the Page_Load Event"

    I overlooked this since I'm using a base class written by someone else.
    The problem was that it rebinded on every page load, resetting the old values.
     
    Non scrivetemi, Feb 7, 2007
    #3
    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. =?Utf-8?B?SUdvdFlvdXJEb3ROZXQ=?=

    sort not working correctly

    =?Utf-8?B?SUdvdFlvdXJEb3ROZXQ=?=, Aug 18, 2004, in forum: ASP .Net
    Replies:
    4
    Views:
    514
    =?Utf-8?B?SUdvdFlvdXJEb3ROZXQ=?=
    Aug 18, 2004
  2. Hermit Dave

    Re: dropdownlist box not working correctly

    Hermit Dave, Sep 2, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    418
    Hermit Dave
    Sep 2, 2004
  3. GS
    Replies:
    7
    Views:
    2,377
    Juan T. Llibre
    Feb 3, 2006
  4. tshad
    Replies:
    4
    Views:
    588
    tshad
    Aug 1, 2007
  5. mark

    Viewstate errors... how do I get viewstate working?

    mark, Feb 20, 2004, in forum: ASP .Net Building Controls
    Replies:
    0
    Views:
    293
Loading...

Share This Page