DotNetNewsgroup.com  
web access to complete list of Microsoft.NET newsgroups
   home   |   control panel login   |   archive  |  
 
  carried group
academic
adonet
aspnet
aspnet.announcements
aspnet.buildingcontrols
aspnet.caching
aspnet.datagridcontrol
aspnet.mobile
aspnet.security
aspnet.webcontrols
aspnet.webservices
assignment_manager
datatools
dotnet.distributed_apps
dotnet.general
dotnet.myservices
dotnet.nternationalization
dotnet.scripting
dotnet.security
dotnet.vjsharp
dotnet.vsa
dotnet.xml
dotnetfaqs
framework
framework.clr
framework.compactframework
framework.component_services
framework.controls
framework.databinding
framework.drawing
framework.enhancements
framework.interop
framework.odbcnet
framework.performance
framework.remoting
framework.sdk
framework.setup
framework.webservices
framework.windowsforms
framework.wmi
frwk.windowsforms.designtime
lang.csharp
lang.jscript
lang.vb
lang.vb.controls
lang.vb.data
lang.vb.upgrade
lang.vc
lang.vc.libraries
  
 
start date: Tue, 31 Jul 2007 19:02:54 +1000,    posted on: microsoft.public.dotnet.framework.aspnet.webcontrols        back       

Thread Index
  1    Rob
          2    Teemu Keiski


SelectedIndexChanged not event firing on DropDownList when changed programatically   
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
Date:Tue, 31 Jul 2007 19:02:54 +1000   Author:  

Re: SelectedIndexChanged not event firing on DropDownList when changed programatically   
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"  wrote in message 
news:uSxG5K10HHA.6072@TK2MSFTNGP03.phx.gbl...

> 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
>
> 
Date:Wed, 1 Aug 2007 20:28:40 +0300   Author:  

Google
 
Web dotnetnewsgroup.com


COPYRIGHT ?2005, EUROFRONT WORLDWIDE LTD., ALL RIGHT RESERVE  |   Contact us