Questions tagged [custom-event]

62 questions
22
votes
2 answers

Create custom wpf event

i've created an UserControl for Database connection where user input Username and Password for a connection. This UserControl is in a MainWindow.xaml Now, in code behind of my UserControl i create a MSSQL connection. If login Successfully, i want to…
davymartu
  • 1,393
  • 3
  • 15
  • 34
14
votes
3 answers

How do I detect a transition end without a JavaScript library?

I'd like to delete an object after it's done animating with a CSS transition, but I'm not able to use a JavaScript library. How do I detect when the animation is done? Do I use a callback or custom event somehow?
Matt Norris
  • 8,596
  • 14
  • 59
  • 90
10
votes
1 answer

jQuery listen globally for custom event

A simplified version of what i'm trying to do is as follows: var indication = $('#some-div'); indication.bind('custom-event', function() { ... } // ... later on! function OtherThing() { $(this).trigger('custom-event'); } I'd like…
Will
  • 5,370
  • 9
  • 35
  • 48
10
votes
8 answers

Firing an event / function on a property? (C#)

I am using a class that I cannot edit, it has a property (a boolean) of which it would be nice to be informed when it changes, I can't edit the properties get or set as I am importing the class from a .dll (which I don't have the code for). How do I…
Lloyd Powell
  • 18,270
  • 17
  • 87
  • 123
8
votes
2 answers

Custom event in HTML, Javascript

I'm looking to create a custom event in HTML, JS. How can I create one such? 'oncustombind' is the custom event I want to create. I should be able to call the function/code defined in the…
varunvs
  • 875
  • 12
  • 23
8
votes
3 answers

How to work with delegates and event handler for user control

I have created a user control that contains a button. I am using this control on my winform which will be loaded at run time after fetching data from database. Now I need to remove a row from a datatable on the Click event of that button. The…
Shantanu Gupta
  • 20,688
  • 54
  • 182
  • 286
8
votes
1 answer

define Custom Event for WebControl in asp.net

I need to define 3 events in a Custom Control as OnChange, OnSave, and OnDelete. I have a GridView and work with its rows. Can you help me and show me this code?
mpourbafrani
  • 109
  • 1
  • 2
  • 7
5
votes
4 answers

ASP.NET TextBox LostFocus event

I need to trigger code on the server side to be called when a TextBox loses focus. I know there is the onblur client side event, and that there is no LostFocus event, so how can I cause a postback to occur when my TextBox loses focus? Update: I have…
Patrick McDonald
  • 64,141
  • 14
  • 108
  • 120
4
votes
2 answers

Custom events (observer pattern)

I can not find how to implement this (I apologize for the freestyle record): //assign the event handler for the object "myObj" myObj.onMyEvent = //do something //if something happened somewhere, then run the event MyEvent.fire(); The idea is…
Kalinin
  • 2,489
  • 8
  • 37
  • 49
3
votes
2 answers

Wrong Derived Class Methods Execution on Event?

public Class A { public A() { someotherclass.someevent += new EventHandler(HandleEvent); } private void HandleEvent(object sender,CustomEventArgs e) { if(e.Name == "Type1") Method1(); else if(e.Name ==…
Venkatesh Kumar
  • 642
  • 1
  • 7
  • 19
3
votes
2 answers

Custom Events in ASP.NET

I want to handle a custom event on an asp.net page with C# as my code Behind. I want to increase the size of the search text box on clicking it. It should be somewhat like this... I know this can be done using event and delegate.I tried something,…
Pavitar
  • 4,282
  • 10
  • 50
  • 82
3
votes
1 answer

Is there a jQuery Equivalent of YUI 2 Custom Event Publish/Subscribe Event Model?

I learned how to develop in Javascript using the YUI 2 library and was wondering if there were a jQuery equivalent of Custom Events (http://developer.yahoo.com/yui/event/#customevent) Specifically, I want to be able to define custom events without…
Abe
  • 6,386
  • 12
  • 46
  • 75
3
votes
4 answers

Propagation of custom events

I expect my CustomEvent to be propagated from document to all the DOM elements. For some reason, it does not happen. What am I doing wrong?