Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Basics
Password Reminder
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old May 30th, 2006, 05:23 AM
Registered User
Join Date: May 2006
Location: , , .
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.

Reply With Quote
  #2 (permalink)  
Old August 26th, 2008, 03:08 AM
Registered User
Join Date: Aug 2008
Location: , , .
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.

Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

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

All times are GMT -4. The time now is 10:46 PM.

Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.