DataGrid Footer - DropDownBox

  • Thread starter Thread starter Jim Heavey
  • Start date Start date
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?
 
You might have overlooked this, but are you checking if !Page.IsPostBack in
your Page_Load event?
 
Back
Top