S
scott blood
Hello,
Can someone help me out here before i go bald or turn to drink to solve all
my problems.
I have a text box on a WebForm that when text is entered and the user moves
away from the control, the postback occours which then replaces the TextBox
with a Dynamically created DropDownList which contains a list of items based
on the text entered by the user.
So far all good, everything works...
Anyhow, the Dynamically created DropDownList's SelectedIndexChanged event is
hooked upto an event as follows.
MyListBox.SelectedIndexChanged += new
EventHandler(MyListBox_SelectedIndexChanged);
But the problem is that when the selected index is changed, nothing fires,
the DropDownBox simply dissapears off the WebForm, which i was expecting as
AutoPostBack is set to true to enable the SelectedIndexChanged event to
fire.
Anyone have any ideas what is happening here.
I have read lots of articles stating that dynamic controls should be created
in the OnInit event of the page, but this is not any good to me because
there could in theory be hundreds of these drop down lists on a WebForm,
basically dependant on the filtering level the user whats to go down to.
Just so no one says 'Why would you want so many DropDownLists' on a form,
this is a financial application for the intranet which is handling millions
and millions and millions of rows of data which need filtering down to the
last penny.
Cheers guys
Can someone help me out here before i go bald or turn to drink to solve all
my problems.
I have a text box on a WebForm that when text is entered and the user moves
away from the control, the postback occours which then replaces the TextBox
with a Dynamically created DropDownList which contains a list of items based
on the text entered by the user.
So far all good, everything works...
Anyhow, the Dynamically created DropDownList's SelectedIndexChanged event is
hooked upto an event as follows.
MyListBox.SelectedIndexChanged += new
EventHandler(MyListBox_SelectedIndexChanged);
But the problem is that when the selected index is changed, nothing fires,
the DropDownBox simply dissapears off the WebForm, which i was expecting as
AutoPostBack is set to true to enable the SelectedIndexChanged event to
fire.
Anyone have any ideas what is happening here.
I have read lots of articles stating that dynamic controls should be created
in the OnInit event of the page, but this is not any good to me because
there could in theory be hundreds of these drop down lists on a WebForm,
basically dependant on the filtering level the user whats to go down to.
Just so no one says 'Why would you want so many DropDownLists' on a form,
this is a financial application for the intranet which is handling millions
and millions and millions of rows of data which need filtering down to the
last penny.
Cheers guys