Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > DropDownList (with AutoPostBack) in a DataGrid

Thread Tools

DropDownList (with AutoPostBack) in a DataGrid

Jaleel Syed via .NET 247
Posts: n/a

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,


From: Jaleel Syed

Posted by a user from .NET 247 (

Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
GridView: Filter DropDownList for another DropDownList =?Utf-8?B?SnVhbmpv?= ASP .Net 0 12-29-2005 07:44 AM
GridView: Filtr DropDownList from another DropDownList =?Utf-8?B?SnVhbmpv?= ASP .Net 0 12-23-2005 01:31 PM
databinding a Dropdownlist to another dropdownlist tshad ASP .Net 8 10-19-2005 10:00 PM
Using a data-bind dropdownlist to populate another data-bind dropdownlist mr2_93 ASP .Net 1 10-02-2005 05:07 PM
how do i access a dropdownlists selected value in a datagrid edititemtemplate column from the selectedindexchanged event of another dropdownlist in a datagrid edititemtemplate column Dave M ASP .Net Datagrid Control 0 12-14-2004 11:53 AM