Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Datagrid ItemCommand

Datagrid ItemCommand

Scheduled Pinned Locked Moved ASP.NET
csharpasp-netdesignregexhelp
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    N Offline
    Neel07
    wrote on last edited by
    #1

    Asp.Net datagrid I want to associate this event OnItemCommand="dgModule_ItemCommand", but when I compile its give me error message "dgModule_ItemCommand(object, System.Web.UI.WebControls.DataListCommandEventArgs)' does not match delegate 'void System.Web.UI.WebControls.DataGridCommandEventHandler(object, System.Web.UI.WebControls.DataGridCommandEventArgs)'" Surprisingly in some of the webpage it does not give this error here is the code snippet protected System.Web.UI.WebControls.DataGrid dgModule; dgModule.ItemCommand += new DataGridCommandEventHandler(this.dgModule_ItemCommand); public void dgModule_ItemCommand(DataListCommandEventArgs e) { int iCount=e.Item.ItemIndex +1; //other lines of code here } Anyone is having clue on that Thanks in advance Share knowledge to enhance your learning

    A 1 Reply Last reply
    0
    • N Neel07

      Asp.Net datagrid I want to associate this event OnItemCommand="dgModule_ItemCommand", but when I compile its give me error message "dgModule_ItemCommand(object, System.Web.UI.WebControls.DataListCommandEventArgs)' does not match delegate 'void System.Web.UI.WebControls.DataGridCommandEventHandler(object, System.Web.UI.WebControls.DataGridCommandEventArgs)'" Surprisingly in some of the webpage it does not give this error here is the code snippet protected System.Web.UI.WebControls.DataGrid dgModule; dgModule.ItemCommand += new DataGridCommandEventHandler(this.dgModule_ItemCommand); public void dgModule_ItemCommand(DataListCommandEventArgs e) { int iCount=e.Item.ItemIndex +1; //other lines of code here } Anyone is having clue on that Thanks in advance Share knowledge to enhance your learning

      A Offline
      A Offline
      Abi Bellamkonda
      wrote on last edited by
      #2

      You have DataListCommandEventArgs, instead of DataGridCommandEventArgs (you got confused betwwen DataList and DataGrid). The error message is correct, just look at it...

      Neel07 wrote:

      "dgModule_ItemCommand(object, System.Web.UI.WebControls.DataListCommandEventArgs)' does not match delegate 'void System.Web.UI.WebControls.DataGridCommandEventHandler(object, System.Web.UI.WebControls.DataGridCommandEventArgs)'"

      Abi ( Abishek Bellamkonda ) My Blog: http://abibaby.blogspot.com =(:*

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups