.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

ProcessCmdKey event not firing

Posted By:      Posted Date: September 13, 2010    Points: 0   Category :Windows Application
I have a fairly involved form that is composed of a lot of telerik controls and also has a ChartDirector chart in it.  I am trying to manipulate a cursor in the chart that will skip from one point to another, and I want to use the arrow keys as one method to move the cursor. I have overridden the ProcessCmdKey event in the Form class that hosts all the controls, and it never fires in my application (I put in break points to be sure).  I have tested the exact same code in a newly created RadForms object that also included similar controls (though not as extensive), and it works just fine.  My conclusion is that there is another event that gets fired first and is intercepting the information before ProcessCmdKey sees it. Is this a reasonable assumption, and if so, does anyone know which event might be being fired and know of a way to check what it's doing?  This single form has a few thousand lines of code, and a truckload of event handlers, so excising them one by one will be time consuming. thanks, David

View Complete Post

More Related Resource Links

MouseUp event not firing on ActivityDesigner class?

I have a custom control derived from ActivityDesigner.  I'm basically retemplating the contol to give it a stylized look and feel ... I want to add the ability to change the Display Name by swapping out the TextBlock with a TextBox on MouseUP - but this event is not firing. I can handle the MouseDown event and it works OK, except it enters the Edit mode when dragging the activity around.  Is the MouseUp handled at the base level?  Is there a way to work around this? 

Disable Login event firing in SP 2007

hello, how can i disable the login event firing in sharepoint ?...i just want to disable the sign in event 

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/

click event only firing for lower 100 pixel portion of vertical div

 I have a div on the left side of my page. when clicked I toggle a hidden div that flies out to the right. But the click event only works on the bottom portion of the div. The hidden div has a close button div in the lower right. to clicks fine. any ideas? code is below jquery <script type='text/javascript'> $(document).ready(function() { var $scrollingDiv = $("#divReportBanner"); $(window).scroll(function(){ $scrollingDiv .stop() .animate({"top": ($(window).scrollTop()) + "px"}, "fast" ); }); $('.toggle-button').click(function() { $("#divLeftMenuBody").animate({width:'toggle'},400); }); $('#divReportBanner').click(function() { $("#divLeftMenuBody").animate({width:'toggle'},400); }); }); </script> html <div id="divReportBanner" ></div> <div id="divLeftMenuBody" runat="server"> <div style=" overflow: scroll; overflow-x:hidden;width:365px; height:370px;">

On click Dialog Box to browse file...NOt firing serverside event...

<script type="text/javascript">    function Open()    {         var fileupload=document.getElementById('fupload');                      fileupload.click();  //       document.form1.submit();    }       </script>protected void Page_Load(object sender, EventArgs e)    {btnimport.Attributes.Add("onclick", "javascript:return Open();");    }<asp:Button ID="btnimport" OnClick="btnimport_onclick" runat="server" Text="Import"/>                                                        <input type="file" runat="server" style="display: none" id="fupload" />protected void btnimport_onclick(object sender, EventArgs e)    {        if (ViewState["CurrentTable"] != nu

List Event Receivers firing for all custom lists

Hello, I have a site with two custom lists, and I have created an EventReceiver class to handle the ItemAdded event for custom lists. I have modified the EventReceiver's Elements.xml file to only handle items added to one of the custom lists instead of all custom lists, by changing: <Receivers ListTemplateId="100"> to <Receivers ListUrl="/Lists/MyCustomList">   however, when debugging, the ItemAdded method is being fired when an item is added in both custom lists. I have had to work around this by checking within the ItemAdded method for the list that fired the event:        public override void ItemAdded(SPItemEventProperties properties)        {            base.ItemAdded(properties);            if (properties.ListTitle.Equals("My Custom List")) { ... } I thought the ListUrl attribute of the Receivers element specifies the event to only fire for the specific list with that url? (see http://msdn.microsoft.com/en-us/library/ms431081.aspx). Is there somewhere else I should be checking?   Thanks

Drop Down Listbox SelectedIndexChanged Event not firing when I programmatically change selection

I have two drop down listboxes (DDL1 and DDL2).  When DDL1 has an index change, DDL2 then has a refresh of list items based off SQL Server SELECT from a table.  The database isn't the problem.  Everything works perfectly when the user selects a new item manually from DDL1.But in my code, I save the user data from the selection of DDL1 in a separate table.  And then upon rendering of the page (Page_PreRenderComplete), I do a SelectedIndex assignment of the value of what's saved in the db table.  That works just fine, it selects the DDL1 item, but DDL2 is unaffected, as if DDL1's SelectedIndexChanged event isn't called like it would be if manually changed.  How can I get around this?Thanks in advance. :)

KeyDown event on a Form is not firing for STX and/or ETX

I'm using a wireless barcode reader that's inputting data using HID. I've configured it to wrap the output between STX and ETX (0x02, 0x03), however, i never get any KeyDown event generated when those keys are sent from the device, the barcode keys are sent just fine but not STX and ETX.

FormView Command Button not firing Item Command Event

Hi, In my content page, I have a formview for Insert & Edit. In insertitemtempalteI have a command button (btnInsert) to trigger  Item_Command event to insert a new record. The button event never gets triggered. But If I set CausesValidation = "false"it fires. But I want the validation to take place. I tried btnInsert_command and btnInsert_Click events. None of them is fired. Ideally I would like to havethe item_command event fired. I would appreciate any inpyt on how to handle this problem. <FormView>     <InsertItemTemplate>            .....           <div>               <asp:Button id="btnInsert" CommandName="Insert" Text="Insert" runat="server" UseSubmitBehavior="true" />              <asp:Button id="btnCancel" CommandName="Cancel" Text="Insert" runat="server" />           </div>     </InsertItemTemplate></FormView>   Thanks Suresh

dynamically created button control click event not firing first time?

HI im creating a button control in page int and im assing a click event for the button control. here the click event is not firing for the first time.can anyone help me with this? here is my code. Button btn = new Button(); btn.ID = "btn"; btn.Click += new EventHandler(btn_Click); Panel1.Controls.Add(btn); Panel1.Controls.Add(new LiteralControl(""));

Connect InfoMessage event is not firing

I'm not able to fire the SQL Connection’s InfoMessage event - here's the code that I've set up The normal message that i'd expect to see in mSQLMessage is "(12 row(s) affected)"  but the mConnect.InfoMessage is not firing.  Any ideas what I'm missing? Public Class Dispatch     Private WithEvents mConnect As SqlConnection         Private Sub SaveSQLMessages(ByVal sender As Object, ByVal e As SqlClient.SqlInfoMessageEventArgs) Handles mConnect.InfoMessage         mSQLMessage &= e.Message & vbNewLine     End Sub     Public Function GetDatatableofJobs() As DataTable         Dim ds As New DataSet         mConnect = New SqlConnection         mConnect.ConnectionString = mStrConnect         Try             mConnect.Open()             Dim da As New SqlDataAdapter("Select * from dbo.vGetPriceItJobs", mConnect)             da.Fill(ds, "Jobs")         Catch ex As Exception   &nbs

URL Routing + PostBack not firing BeginRequest event


hi all,

we are having some weird issues with URL Routing in ASP.NET 3.5. 

We have a search box that does a search and redirects to a routed URL.

 When we search for the first time (aka Press a button that forces a postback) everythign works as expected.  we get:

1. BeginRequest event.

2. Determines Route

3. Calls Routehandler to match the route item to the actual destination page

4. Routes the url appropriately.

After you do one search successfully and try again it fails to call the BeginRequest event.  Because of this the routing data never gets called and so the url is never routed to its correct destination.   What is weirder still if we append a "/" (trailing slash) to the url after the initial postback it DOES work properly again. 

So our search route looks like this


entering a term and pressing the SEARCH button would yield a result url like this:



Going back (after 1 successful search) you then need to use this url or else BeginRequest will never fire:

mydomain.com/Search/ < (note the extra "/" at the end)


Anyone have an idea a

Custom WebPart .LoadControl(.ascx) event not firing


I am creating a Webpart which loads a custom control (.ascx) in the CreateChildControls Event

        protected override void CreateChildControls(EventArgs e)

            _userControl = Page.LoadControl(@"/_controltemplates/ControlTemplates/CustomUserControl.ascx");
            _userControl.ID = "usrSearchResults";


In the codebehind of this user control (I am using the inherits model as in ASP.NET 1.1) I have an InitializeControls method which binds the eventhandlers to an already existing DropDownList on the user control.

Markup in the .ascx file
    <asp:DropDownList ID="ddlRegions" AutoPostBack="true" runat="server" DataTextField="Title"
        DataValueField="Title" EnableViewState="true">

EventHandling code in the code behind of the user control.  This code runs in every Page_Load event.

ddlRegions.DataBound += new EventHandler(ddlRegions_DataBound);
The problem is that when the selected values in the dropdownlist changes the event handler does not fire (a post does occur though).  Am I missing something here?


row deleted event not firing


hii.. i wrote the following code to perfrom the inline deletion of datagrid elements.

protected void GridView1_RowDeleted(object sender, GridViewDeletedEventArgs e)
        Response.Write(" Sucessfully deleted");

    protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e)

        string cmdString = // some command

        using (SqlConnection sqlCon = new SqlConnection(conString))
            SqlCommand sqlCmd = new SqlCommand(cmdString, sqlCon);
            SqlTransaction sqlTrans = sqlCon.BeginTransaction();
            sqlCmd.Transaction = sqlTrans;
            catch (Exception ex)
                Console.WriteLine("error is: ", ex.Message);
                catch (Exception ex2)
                    Console.WriteLine("error is: ", ex2.Message);

the row deleted event is not firing and the row deleting event is firing twice. why is is

Dropdownlist in a repeater firing the SelectedIndexChanged event


I have a dropdownlist in a repeater and it's firing the SelectedIndexChanged event but in teh event handler I can not get the dataitem associated with the row that the DDL is in.  Here is the code:

        private void pt_SelectedIndexChanged(object sender, EventArgs e)
            DropDownList ddl = (DropDownList)sender;
            RepeaterItem ri = (RepeaterItem)ddl.NamingContainer;
            int userdevi

Gridview update event not firing


Everything is working fine on my gridview except the Update.  When I click on the Update link, nothing happens.  I've researched the problem and tried various solutions I've seen, but no luck.  I'm hoping someone else can see something that I'm missing. 

<asp:GridView ID="grdAddInsured" runat="server" DataSourceID="dsUnitAdditionalInsured" DataKeyNames="AddInsuredID"

AutoGenerateColumns="False" ShowFooter="True" Width="

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