Sean Rhone

<< Progress Made | Home | CSLA .NET VB 3.6.3 >>

Today I was assigned a a page to finish up for a internal ASP.NET 3.5 application and was working on editing records in the gridview. There are two LinkButtons named for edit and remove and when the user clicks edit button the record is suppose to populate in a form above the grid. Sounds easy enough except when I clicked the link and handled the event so I could populate the form the grid when into editmode as well.

Ok, I've never done in-grid editing but know enough to look at the autocreate* settings to turn this off and was very surprised to see they were not enabled. So, it's time to dig around and the answer is explained in the link below but the short answer is the command name attribute auto enables functionality if you use "Edit", "Delete", or "Select".

Now I'm all for making things easier but auto enabling functionality by a text value is silly. It took me a while to find this and bet I'm not the only person who hit this wall.

So, next time your gridview it auto editing,selecting, or deleting and you don't know why check out the ButtonField or Templete field for command values.

http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.gridview.aspx
  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati
  •   Short Url: http://wblo.gs/YsH

Print | posted @ Wednesday, August 12, 2009 7:15 PM

Comments on this entry:

No comments posted yet.

Post A Comment
Title:
Name:
Email:
Website:
Comment:
Verification:
 
 

About
  • Contact
  • Login
Archives
  • October, 2009 (1)
  • September, 2009 (1)
  • August, 2009 (1)
  • July, 2009 (2)
  • May, 2009 (1)
  • April, 2009 (1)
  • February, 2009 (2)
  • January, 2009 (3)
  • September, 2008 (2)
  • May, 2008 (1)
  • January, 2008 (3)
Great Blogs
  • Scott Guthrie's Blog
Syndication
  • RSS
  • ATOM

© Ramblings

Key West theme by Robb Allen.