DropDownList (with AutoPostBack) in a DataGrid

  • Thread starter Jaleel Syed via .NET 247
  • Start date
J

Jaleel Syed via .NET 247

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,810
Latest member
Kassie0918

Latest Threads

Top