eventhandler

Adding new eventHandler in RadioButton CheckedChanges in dynamic table

Hi! I`m trying to add another eventHandler to RadioButton. This is the sample code(which is working): asp.net: <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label> <asp:PlaceHolder ID="PlaceHolder1" runat="server"></asp:PlaceHolder> <asp:Button ID="Button1" runat="server" Text="Button" /> C#: protected void Page_Load(obje...

Howto removeEventListener with <mx:SetEventHandler /> ?

Hi there, I'm trying to remove an eventlistener on (in this specific case) a HorizontalList. The list is initialized with the property itemRollOver="playPreview(event)" I'd like to remove this eventListener by switching state and stating something like: <mx:SetEventHandler target="{horList}" name="itemRollOver" handlerFunction="nu...

Please some details on the MXML tag <mx:SetEventHandler />

Can anyone give me some details on the proper use of the tag <mx:SetEventHandler /> used when switching states? The Flex documentation is not very elaborate on this subject. Especially removing event handlers has my interest. This question is a more specific formulation of my preceding post: http://stackoverflow.com/questions/1973946/ho...

In C# why can't I pass another class' EventHandler reference and how can I get around it?

If I have ClassA that has a public event, SomeEvent, and ClassC that has method, addListener, that accepts an EventHandler reference, why can't ClassB have a line that says c.addListener(ref a.SomeEvent)? If I try I get a compiler error that says: "The event 'ClassA.SomeEvent' can only appear on the left hand side of += or -= (except wh...

Handle flex events without using a framework?

I'm developing an AIR application with Flash Builder 4 Beta 2 (nightly SDK) an am not using a framework like mate. I have a couple of views and components in my application. An outline might look like this: root |- mainview |-- toolbar |-- catalogue view |--- tree |--- datagrid |-- statusbar This is not 100% the structure of my projec...

C# Dynamic template implicit conversion error from System.EventHandler to System.EventHandler<TEventArgs>

Code: public void InstantiateIn(System.Web.UI.Control container) { PlaceHolder ph = new PlaceHolder(); SectionArgs e = new SectionArgs(); ph.DataBinding += new EventHandler<SectionArgs>(ItemTemplate_DataBinding); container.Controls.Add(ph); } static void ItemTemplate_DataBinding(object s...

WPF: Event Handlers in Codebehind's Constructor not hooking up.

Hi there! Sit Rep I have a WPF app. In the constructor of the (C#) code-behind I attach a button event-handler. Problem is, it doesn't attach! But if I attach it via clicking a UI button, then the button works fine. Also, of course, if I attach it in the button's XAML it works too. So, it appears that the prob is attaching the handler...

F#: Add and remove event handlers

I'm trying to add & remove an event handler from a Silverlight FrameworkElement, but I just can't get the syntax correct. I want to do something like this: let clickedEventHandler = fun args -> printfn "Click!" fe.MouseLeftButtonDown.AddHandler( clickedEventHandler) ... fe.MouseLeftButtonDown.RemoveHandler(clickedEventHandler) What s...

UIElement.AddHandler() vs .Event += Definition

Hi ! 1.st part of the quesion: What is the difference between these 2 event registrations ? _popUp.AddHandler(PreviewMouseLeftButtonDownEvent, new MouseButtonEventHandler(PopUp_PreviewMouseLeftButtonDown)); _popUp.PreviewMouseLeftButtonDown += new MouseButtonEventHandler(_popUp_PreviewMouseLeftButtonDown); 2.nd part of the question:...

How do I write a mouse down event in JavaScript?

Hi, This is very basic I'm sure to JavaScript but I am having a hard time so any help would be appreciated. I want to call a function within a for loop using the mouseDown event occurring within an object's second child node. The part italicized is my attempt to do this. The swapFE function is still a work in progress by the way. And o...

Onmousedown in JavaScript not working --help!

The following function is supposed to execute during the "onload" event of my webpage. function setUpTranslation() { var phrases = document.getElementsByTagName("p"); for (i = 0; i<phrases.length; i++) { phrases[i].number = i; phrases[i].childNodes[1].innerHTML = french[i]; phrases[i].childNodes[1].onMouseDown ...

EventHandler, event, delegate based programming in Python any example would appreciate?

Basically I'm a C# developer, I know the way C# does, EventHandler, delegate, even... but whats the best way to implement it on Python. ...

Fire a template child event in current context?

Hello. Is there a way to fire an event from a visual within a DataTemplate in the current context (i.e. Page, Window, UserControl etc.). For example I have a DataTemplate that contains a button or a ListBox. I want that when the button is clicked or when ListBox.SelectionChanged is fired in the ListBox, the event handler should be decl...

Why do I get a "Object reference not set to an instance of an object" on my custom OnLoaded event?

What do I have to do to get this code work? I simply want the class to throw an event when it is finished loading and the consuming class to react to it. It gets an error on OnLoaded saying it is null. using System; using System.Windows; namespace TestEventLoaded8282 { public partial class Window1 : Window { public Wi...

How can I make consuming custom events on my classes optional?

When I comment out the fm.OnLoaded line below, it gives me an error that OnLoaded is null. How can I make it optional for the caller of my class to consume the event or not as with .NET classes / events? using System; using System.Windows; namespace TestEventLoaded8282 { public partial class Window1 : Window { public W...

How do you trigger an event across classes?

I am writing a Class Library that will be used by other applications. I am writing it in C#.NET. I am having a problem with triggering events across classes. Here is what I need to do... public class ClassLibrary { public event EventHandler DeviceAttached; public ClassLibrary() { // do some stuff OtherClass....

How do you trigger an event across classes?

I am writing a Class Library that will be used by other applications. I am writing it in C#.NET. I am having a problem with triggering events across classes. Here is what I need to do... public class ClassLibrary { public event EventHandler DeviceAttached; public ClassLibrary() { // do some stuff OtherClass....

Is it possible to "chain" EventHandlers in c#?

Is is possible to delegate events from inner object instance to corrent object's event handlers with a syntax like this: public class MyControl { public event EventHandler Finish; private Wizard wizard; public MyControl( Wizard wizard ) { this.wizard = wizard; // some other initialization going on here... /...

SharePoint ItemAdded Event Delay

Yet another question. So now my EventReceiver and its logic is working just fine. Except for one thing. Basically it queries the whole list through CAML queries, and then passes the result to a DataTable object, and later on to a DataRow object... Like all, in test environment, it works perfectly, but in production... What happens is...

Validate a XDocument against schema without the ValidationEventHandler (for use in a HTTP handler)

Hi everyone, (I am new to Schema validation) Regarding the following method, System.Xml.Schema.Extensions.Validate( ByVal source As System.Xml.Linq.XDocument, ByVal schemas As System.Xml.Schema.XmlSchemaSet, ByVal validationEventHandler As System.Xml.Schema.ValidationEventHandler, ByVal addSchemaInfo As Boolean) I a...