.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

ModelChanged event handler missing event args

Posted By:      Posted Date: October 02, 2010    Points: 0   Category :Windows Application
I have implemented a ModelChanged event handler in my AddDesigner call as follows:

             _wd.ModelChanged += wd_ModelChanged;

The code for the ModelChanged event is:

private void wd_ModelChanged(object sender, EventArgs e)
            ModelChangedEventArgs changedEventArgs = e as ModelChangedEventArgs;

            if(changedEventArgs != null)
                IEnumerable<ModelItem> itemsRemoved = changedEventArgs.ItemsRemoved;

                foreach (ModelItem modelItem in itemsRemoved)
                    if (modelItem.ItemType == typeof(Flowchart))
                        MessageBox.Show("You can not delete the base flow chart!", _appName, MessageBoxButton.OK, MessageBoxImage.Stop);

            //Add the expression text boxes to all switch and descision flow activities

The issue I have is that there are no event args coming through, when I expected there to be event arguments from the editing context. Any ideas on what I have missed?

View Complete Post

More Related Resource Links

Event handler lightning bolt missing in VS2010


I have recently upgraded from VS2008 to VS2010 after a few months away from ASP.NET coding and I am hitting a problem I never had before. I seem to remember having a lightning bolt icon in the properties window for a web form that would automatically create the skeleton event handler code for any one of a range of page events. However, I cannot see this lightning bolt anywhere in VS2010.

Some guidance would be much appreciated. It would be a chore to have to create this code every time from scratch.


Creating Event Handler in Code behind


Hi, so I have a control that is created in the code behind and generates fine but I can't figure out how to create an event handler for it.  I've found plenty of examples for it in C sharp, but none of them seem to apply to VB.  What I want to do is essentially this:

myDropDownList.SelectedIndexChanged = "Event to do here"

but it doesn't seem to work for me.

Any suggestions are appreciated.

want to launch modal Popup from created User Event handler




I have a create user wizard on my page and in the event handler (Created User) I get extra information from the user

via textboxes within the aspx etc.


I then do a response.redirect to another page.

What I want to happen is this


When the CreatedUser Event is fired, I  want a Modal Popup to show up with a message Processing your registration.

once the registration code is processed it will close and the users get redirected.


On my ASPX I have the Modal PopUp and a Panel.

In the code behind in the handler I put ModalPop.show()


but this does not work.


thanks for any suggestions



InfoPath Workflow Task Form "Loading" event handler only being called after App Pool recycled.


I have a Workflow that is using an InfoPath task form.  In the "FormEvents_Loading" method event handler I have some code that needs to run each time the form is opened.   I recycle the App Pool and open the form the code runs perfectly, but if I close and try to re-open the form the code is not run at all.  I can then recycle the App Pool again and on the next load the code executes just fine.   The code that is supposed to be run is a very simple statement to set a field value, so I don't think it is interfering.

Does anyone know what this might be?


Event Handler Credentials


I made EH that checks out document when OOB Approval WF is finished successfully.

I want doc to be checked out by WF Initiator, but by default it is made by System Account.

How can i change Event Handler Account ?

Pre_Init event handler problem


Hi all my friends

   I have to masterpages for my home page.

1. The first is for the annonymous users which has the login controls. its name is General_Anonymous.master.

2. The second one is for the logged in users which has a logout button and it hasn't the login controls in it. its name is General_LoggedIn.master.

in my default.aspx page I wrote the following code

protected void Page_PreInit(object sender, EventArgs e)
            if (Session["SupId"] == null && Session["CustomerId"] == null)
                this.MasterPageFile = "~/Masters/General_Anonymous.master";
                this.MasterPageFile = "~/Masters/General_LoggedIn.master";

Event Handler & AD

My event handler is working fine until i add AD part. After this string it stops firing at all: DirectoryEntry dom = new DirectoryEntry(); I mean it compiles, deploys and doesnt react to anything ( Why ? PS VS2010, SP2010  

how to get values of list item being entered in ItemAdding event handler?

Hi,          i am trying to get the values being entered in a listitem in the ItemAdding eventhandler as follows, but it doesnt work. public override void ItemAdding(SPItemEventProperties properties)         {             base.ItemAdding(properties);             SPSite CurrentSite = new SPSite("http://mm-moss/np/");             SPWeb CurrentWeb = properties.OpenWeb();             SPList CurrentList = CurrentWeb.Lists[properties.ListId];             string vehicleNo = CurrentList.Items[CurrentList.Items.Count - 1]["Vehicle No"].ToString();             string  name=CurrentList.Items[CurrentList.Items.Count-1]["Name"].ToString(); } when i debug i cant get hold of the VehicleNo value. canyone help me in getting the values of the list item being entered? Thank you all.

Create a meeting instance with an event handler

Hi, i want to know if its posible to insert a new meeting instance in a meeting workspace automatically when you add a new event in a calendar.   i try to pass automatically the option of the template selection.   its posible with the objetc model or web services?   thanks

Event handler that will take an e-mail sent to a doc library and save it as an .MSG file within the

Hi All, I have a requirement to create an event handler that will take an e-mail sent to a doc library and save it as an .MSG file within the library? Any help/inputs on getting this done is much appreciated.  Hanif

Sharepoint Event Handler not firing

I have written an event handler for an ItemAdded eventfor a document library. I am trying to read an excel file being uploaded and extract a value from it which I write to a list column for the item. I have this working properly on my development machine which is a Windows Server 2003 machine.However, on a production Windows Server 2008 machine, the event handler never fires. I am doing a simple write to a log file to test and see if it runs at all even if the Excel parsing does not work but I get no indication that it ran. The event handler is being registered with a feature that I am deploying. I have verified that the event handler is registered to the library by using the u2u Event Handler Explorer tool.Is there any way I can determine if my event handlers are even executing? How can I debug this?

ItemAdded Event Handler not firing

Hi, I have created an ItemAdded Event handler that is linked to a content type. This event handler does certain custom validations and then sends Email to users. I have referenced this event handler in XML file as well but somehow the event handler is not getting fired...Following is the code.   Code Snippet            this.DisableEventFiring();            using (SPSite site = new SPSite(properties.SiteId))            {                 using (SPWeb web = site.OpenWeb())                {                    base.ItemAdding(properties);                     SPList nList = web.Lists["NList"];                    SPList IList = web.Lists["IList"];                     foreach (SPListItem listItem in nList.Items)                    {                        if (listItem["Topic"].ToString() == properties.ListItem["Topic"].ToString())                        {                            SPUser alertUser = (SPUser)(properties.ListItem["SUser"]);                            SPUtility.SendEmail(web, false, true,alertUser.Email,"New item added", "A new item has been added");                         }                    }                    this.EnableEventFiring();                }            }       The XML file is: Code Snippet  <XmlDocuments>      <XmlDocument NamespaceURI="http://schemas.microsoft.com/

missing event in RichTextBox

I'm developing an application that uses the RichTextBox extensively, I need an event that gets triggered at the moment when the vertical scroll bar of the richTectBox appears . so instead of scrolling down to see the rest of the text I want to create another RichTextBox that will hold the rest of the text which didn't fit in the first one …I want to achieve the same functionality as in MS word. I tried so hard to achieve that functionality but it wasn't successfull … I tried to fake it using the SizeChanged event but it wasn't practical because the size of the richTextBox gets changed a lot during the life time of the application   is there such event in windows forms ? … and if not , is there one in WPF ?

Event Handler not picking up error

I have a connection manager which uses a Variable as part of a ConnectionString. I have tried putting an Event handler on the package to capture any errors with the connection string. Unfortunately the event handler does not pick up any errors. I would like to add some screenshot but i am not sure how to do it on this forum.  Mr Shaw

missing event Handles variable

There is a missing event Handles variable found in the VB button code.What is the missing variable? Here is the code:Imports System.Data Imports System.Data.SqlClient Partial Class _Default Inherits System.Web.UI.Page Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click ' strLong Dim conn As New SqlConnection(ConfigurationManager.ConnectionStrings("DB_13299_applicationConnectionString").ToString()) Try Dim cmd As SqlCommand = conn.CreateCommand() cmd.CommandText = "INSERT INTO Application ( First, Last, City, State) VALUES (@First, @Last, @City, @State);" cmd.Parameters.Add(New SqlParameter() With { _ .ParameterName = "@First", _ .DbType = SqlDbType.NVarChar, _ .Value = First.Text _ }) cmd.Parameters.Add(New SqlParameter() With { _ .ParameterName = "@Last", _ .DbType = SqlDbType.NVarChar, _ .Value = Last.Text _ }) cmd.Parameters.Add(New SqlParameter() With { _ .ParameterName = "@City", _ .DbType = SqlDbType.NVarChar, _ .Value = City.Text _ }) cmd.Parameters.Add(New SqlParameter() With { _

Event handler to delete minor versions in document libraries

Hi Is there a way we can capture the deletion of minor versions in document libraries using any event handler. May not be using the delete all the minor versions but at least when we use the option to delete the selected minor version. I do not see the ItemUpdating and ItemUpdated getting fired in this case. Thanks wpwije  

Sequence - Container Event Handler - send one Email

I have a sequence container which contains three data flows. Have placed a event handler on the sequence container which emails me OnError. When   an error occurs i only want to get one email but I get eleven. This equals the number of tasks happening inside the sequence container. How can I get just one email? Mr Shaw
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend