Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > SelectedIndexChanged not event firing on DropDownList when changed programatically

Reply
Thread Tools

SelectedIndexChanged not event firing on DropDownList when changed programatically

 
 
Rob
Guest
Posts: n/a
 
      07-31-2007
Hi,

We have a custom control which contains a number of dropdownlists. Within
the custom control class we have a handler for the SelectedIndexChanged
event. This event fires when the user selects an item from the dropdownlist,
but it's not firing when we change the selected value in the custom
control's properties. It changes the selected value successfully, but no
event is fired.

In addition to this, changing the selection in one dropdownlist causes the
available selections in the other dropdownlist to change. This is working
successfully, however, when I attempt to access the new list, I'm unable to
because it's still holding the old values.

Can anybody tell me what I might be doing wrong. Unfortunately I can't
provide any code snippets because I'm writing this post from home

Thanks


 
Reply With Quote
 
 
 
 
Teemu Keiski
Guest
Posts: n/a
 
      08-01-2007
Hi,

that's by design if I understand your description correctly. ASP.NEt throws
events only based on user interaction, e.g when user has changed the
selection on the browser e.g at client. But if you change it
programmatically (in server-side code), no event is fired.

It's explained in

ASP.NET Web Server Control Event Model
http://msdn2.microsoft.com/en-us/library/y3bwdsh3.aspx


--
Teemu Keiski
AspInsider, ASP.NET MVP
http://blogs.aspadvice.com/joteke
http://teemukeiski.net


"Rob" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi,
>
> We have a custom control which contains a number of dropdownlists. Within
> the custom control class we have a handler for the SelectedIndexChanged
> event. This event fires when the user selects an item from the
> dropdownlist, but it's not firing when we change the selected value in the
> custom control's properties. It changes the selected value successfully,
> but no event is fired.
>
> In addition to this, changing the selection in one dropdownlist causes the
> available selections in the other dropdownlist to change. This is working
> successfully, however, when I attempt to access the new list, I'm unable
> to because it's still holding the old values.
>
> Can anybody tell me what I might be doing wrong. Unfortunately I can't
> provide any code snippets because I'm writing this post from home
>
> Thanks
>
>



 
Reply With Quote
 
 
 
Reply

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
dropdownlist selectedIndexChanged event not firing =?Utf-8?B?Q3VybHlGcm8=?= ASP .Net 1 08-14-2005 04:21 PM
DropDownList SelectedIndexChanged event not firing when in a panel Paul Lacey ASP .Net 2 02-17-2005 09:51 AM
DropDownList.SelectedIndexChanged event not firing BentleyInc ASP .Net Web Controls 4 12-14-2004 04:58 AM
SelectedIndexChanged event of a DropDownList sometimes not firing Lew Barnesson ASP .Net 3 12-04-2004 07:56 PM
dropdownlist selectedindexchanged event not firing.. please help. DesignerX ASP .Net 2 11-14-2003 03:25 PM



Advertisments