Thursday, September 25, 2008

GridView bug that fire RowCommand twice

I was trying my hands on .NET 3.5, and discovered that Gridview was firing Rowcommand twice for my ImageButton that is drawn using ButtonField Column. Later I found that this is a bug/unexpected behaviour from out of the box Gridview. I found some solution on internet that can be seen in detail here:
http://forums.asp.net/p/1002747/1324414.aspx#1324414
It mainly suggest to use TemplateField column with imagebutton, as Imagebutton is not quite compatible with ButtonField. Rest you can read above for details on it.