DataGrid Footer - DropDownBox

J

Jim Heavey

Hello
I have a datagrid that has a footer that I have place a
dropdownbox on and loaded the values in the datalist in
the ItemCreated Event.

Everything is just as I expected when the grid is
presented. I select some value from the DropDownList and
then press a command button, also on the footer. By the
time I get to the event which handles the button click
event (CommandName Property in the datagrid), the
selectedindex property of the dropdownlist is -1.
Somehow I have lost the setting which was set prior to
the command button being pressed.

Tracing the events, I see that the ItemCreated Event
runs, but I have the code logic such that it is not
reaching the code which reloads the DropDownList and
there by resetting the selected index. It runs the Page
Load and then it runs the command event in which the
index is setting at -1.

Any ideas as to why my index is -1?
 
G

George Durzi

You might have overlooked this, but are you checking if !Page.IsPostBack in
your Page_Load event?
 

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

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,817
Latest member
DicWeils

Latest Threads

Top