Wrox Programmer Forums
ASP.NET 2.0 Basics If you are new to ASP or ASP.NET programming with version 2.0, this is the forum to begin asking questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old May 30th, 2006, 05:23 AM
Registered User
Join Date: May 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default OnRowCreated fired twice

Hi all,

I have a GridView on my page where I implement an event handler for the RowCreated event. My grid allows sorting and paging.
I noticed that when paging / sorting my eventhandler is called twice for every row in the grid. Once before sort/page and once after sort/page.
I'm an Anthem user (ajax framework for asp .net). First I thought that it was an anthem problem, but when I tried it with a normal asp gridview, I noticed the same behaviour.

I guess this is not a bug, so I'm not asking/looking for a solution. I just don't understand why each gridviewrow is created twice when sorting/paging.

Manu aka TweeZz.

Old August 26th, 2008, 03:08 AM
Registered User
Join Date: Aug 2008
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts


I faced the same problem. I googled for a solution and found this thread. I understand that you posted this a long time ago, so I reply primarily for Google to have a solution :)

As far as I understand, this is not a problem, but normal behaviour of the GridView with enabled ViewState. OnRowCreated is first fired when the GridView is being loaded from ViewState, and is subsequently fired again when it is being populated with actual data. So if you have viewstate enabled, there is no way and no need to fix this.

Similar Threads
Thread Thread Starter Forum Replies Last Post
DataGrid ItemCommand not fired jigsawcube1 General .NET 0 September 13th, 2007 06:33 AM
Submit button not fired. r_taduri ASP.NET 2.0 Professional 1 August 30th, 2006 12:51 AM
SortCommend event is being fired twice anup_daware .NET Framework 2.0 2 August 9th, 2006 12:19 AM
"onchange" not fired fskilnik Dreamweaver (all versions) 2 January 2nd, 2006 05:23 PM
Session_Start event not fired rl ASP.NET 1.0 and 1.1 Professional 20 February 22nd, 2005 04:29 PM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.