Dropdownlist not keeping viewstate after postback

Discussion in 'ASP .Net Datagrid Control' started by David Wyn Davies, May 27, 2005.

  1. I have a complex datagrid containing several ASP.NET form elements.
    One of the elements is a checkboxlist. This is populated from a
    database but the data it is populated with is dependent upon the
    current value in one of the datagrid's dropdownlist boxes.

    The dropdownlist is set for AutoPostBack. However, when the postback
    occurs and the datagrid redisplayed, the dropdownlist doesn't keep the
    value it had when postback ocurred.

    How do I get around this problem?

    Thanks,
    David
     
    David Wyn Davies, May 27, 2005
    #1
    1. Advertising

  2. David Wyn Davies

    Mona Guest

    Hi David,

    For your query, you would need to check following three things:

    1. You need to populate the Dropdown list when the page is not post back,
    i.e, If !PostBack then populate it.

    2. You need to populate the CheckBox everytime the page loads.

    3. Please ensure the Enable.ViewState property is set to true.

    HTH

    Mona[Grapecity]


    "David Wyn Davies" <david***> wrote in message
    news:...
    >I have a complex datagrid containing several ASP.NET form elements.
    > One of the elements is a checkboxlist. This is populated from a
    > database but the data it is populated with is dependent upon the
    > current value in one of the datagrid's dropdownlist boxes.
    >
    > The dropdownlist is set for AutoPostBack. However, when the postback
    > occurs and the datagrid redisplayed, the dropdownlist doesn't keep the
    > value it had when postback ocurred.
    >
    > How do I get around this problem?
    >
    > Thanks,
    > David
     
    Mona, May 30, 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. Jay Walker
    Replies:
    2
    Views:
    2,422
    Jay Walker
    Feb 8, 2004
  2. Calvin X
    Replies:
    10
    Views:
    913
    Calvin X
    Aug 19, 2004
  3. Rodusa
    Replies:
    2
    Views:
    6,391
    Rodusa
    Feb 15, 2005
  4. Don
    Replies:
    1
    Views:
    261
    mr fox
    May 16, 2005
  5. Jason
    Replies:
    0
    Views:
    302
    Jason
    Nov 11, 2006
Loading...

Share This Page