DropDownList (with AutoPostBack) in a DataGrid

Discussion in 'ASP .Net' started by Jaleel Syed via .NET 247, Apr 23, 2004.

  1. Hi,

    I have a Search page, which has a Search Button which whenclicked, Binds a DataGrid to the Data returned from Search(whichimplies that I am not Binding the Grid in Page_Load method). Inthe EditTemplate, I have a DropDownList with AutopostBack Trueand I have also defined a SelectIndexChanged event Handler forit. Along with the DropDownList, I also have a two ListBoxes andAdd and Remove Buttons. The first ListBox should be filleddepending upon which option is selected in the DropDownList(I amfilling the List Box in the Item_DataBound method of theDropDownList). The problem is, when the OnSelectIndexChanged ofthe DropDownList is getting fired, I am losing all the Controlsin the EditTemplate.

    I thought that maybe if I Bind the Grid in Page_Load(Out sideif(not postback) construct) I might solve the problem. But whenI tried that, when OnSelectIndexChanged event of theDropDownList gets fired, I am having my controls in place, but Iam losing my selection I make in the ListBox(thats because, I amBinding the Grid on each postback......which fires theItem_DataBound event handler)............

    Please Help


    Thanks in advance,

    Jaleel


    --------------------------------
    From: Jaleel Syed

    -----------------------
    Posted by a user from .NET 247 (http://www.dotnet247.com/)

    <Id>PWqyfYKn/kSakHvYPyFtcQ==</Id>
    Jaleel Syed via .NET 247, Apr 23, 2004
    #1
    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. Null
    Replies:
    1
    Views:
    570
    S. Justin Gengo
    Aug 5, 2003
  2. George Durzi
    Replies:
    0
    Views:
    714
    George Durzi
    Aug 15, 2003
  3. S. Justin Gengo
    Replies:
    0
    Views:
    3,127
    S. Justin Gengo
    Aug 15, 2003
  4. Daniel Doyle
    Replies:
    1
    Views:
    601
    Steve Caliendo
    Jun 25, 2004
  5. Arthur

    dropdownlist autopostback when editing in datagrid

    Arthur, Aug 5, 2003, in forum: ASP .Net Datagrid Control
    Replies:
    0
    Views:
    147
    Arthur
    Aug 5, 2003
Loading...

Share This Page