Itemcommand event uses wrong comand

Discussion in 'ASP .Net Datagrid Control' started by Daisy, May 24, 2004.

  1. Daisy

    Daisy Guest

    Hi All.

    I have a simple web application with a single webpage. it contains a
    single datagrid control which loads data via a Microsoft CRM proxy
    without any problems. It also contains the two default linkbutton
    colums for Edit and Delete.

    I have created the Item command event handler which handles the
    datagrid's itemcommand event. When I click the edit link it receives
    'Edit' as its commandname. Now the datagrid correctly displays its
    edit mode with the two update and cancel buttons. But when I click the
    update link the itemcommand handler receives 'Edit' as its commandname
    again and when clicking the Cancel link it receives 'Delete' as its
    commandname. Any ideas anyone?

    The strange thing is the same application runs correctly (correct
    commands received) running on a different machine ( a win XP with
    visual studio .net installed running .net framework version 1.1).

    The machine which gives me problems is a Win server 2003 running as a
    Virtual PC with Microsoft CRM and Framework 1.1 installed.

    Any help appreciated!
     
    Daisy, May 24, 2004
    #1
    1. Advertisements

  2. Daisy

    Daisy Guest

    Hi All,

    is my question too stupid or too difficult to answer?

    I need any clues I can get! Should I install the .Net framework again
    or is there a different problem?

    thanx in advance

    Daisy
     
    Daisy, May 26, 2004
    #2
    1. Advertisements

  3. Daisy

    Rick Spiewak Guest

    Check the properties of the buttons to make sure that they have the correct
    command associated with them. But, why use the ItemCommand event at all for
    these? There are specific Edit, Update, Delete eventhandlers.
     
    Rick Spiewak, May 26, 2004
    #3
  4. Daisy

    Daisy Guest

    Thanx for your reaction Rick

    They do have the right commandnames and using the specific
    eventhandlers doesnt make any difference.
    It is like the datagrid is going into update mode but doesnt update
    the commandnames associated with the two link buttons.
    Like I said when running the exact same project on a different system
    it is working correctly.

    Daisy
     
    Daisy, May 27, 2004
    #4
  5. Daisy

    Ken McAndrew Guest

    Did anyone come up with a solution for this? I'm having a similar problem.
    I'm creating my datagrid dynamically, and used an EditCommandColumn to get
    the Edit/Update/Cancel links. I also set up the appropriate subs with the
    Handles property for each command. It does edit mode fine, but when I click
    Update, it fires the EditCommand again (with the command name still set as
    "Edit"), and when I click Cancel, it removes the row from the datagrid. This
    is on WinXP Pro, VS.Net 2003 Enterprise, Framework 1.1.

    Thanks.
     
    Ken McAndrew, Jul 9, 2004
    #5
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.