Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > .NET 2.0 and Visual Studio. 2005 > .NET Framework 2.0
|
.NET Framework 2.0 For discussion of the Microsoft .NET Framework 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the .NET Framework 2.0 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 August 1st, 2006, 06:12 AM
Authorized User
 
Join Date: Mar 2006
Posts: 28
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to anup_daware Send a message via MSN to anup_daware Send a message via Yahoo to anup_daware
Default SortCommend event is being fired twice

Hi Group,

In my application I am using a datagrid, now I m implementing sorting for that datagrid,
I am changing the flag for ascending and descending when SortCommand event of datagrid is fired.

Now the problem I am facing is that the Sort Command event is being fired twice even if I click the header in datagrid only once thus my flag is getting reset to the original value.

(I know that the event is first raised during the restoration of the page's view state. The second notification arrives when the page is being built.)

Please help me out in this!!

Thanks,

Anup Daware
Anup.daware@gmail.
__________________
--Everything you can imagine is real.--
 
Old August 4th, 2006, 04:56 AM
Friend of Wrox
 
Join Date: Sep 2004
Posts: 140
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Check what is happening in "postback" may be thats the culprit

 
Old August 9th, 2006, 12:19 AM
Authorized User
 
Join Date: Mar 2006
Posts: 28
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to anup_daware Send a message via MSN to anup_daware Send a message via Yahoo to anup_daware
Default

Well got the solution..

I registered the event "OnSort.." and also defined it in properties of Datagrid in aspx page like >>

<asp:datagrid id="Dgrid" allowsorting="TRUE" OnSortCommand="event...">

removing the OnSortCommand property will solve the problem.
This also applies to any other event fired twice..

Thanks and Regards,
Anup Daware

Best Regards,
Anup
&lt;Today is the first day of your rest of life.. Make most of it&gt;





Similar Threads
Thread Thread Starter Forum Replies Last Post
What if I need control value before event is fired pauliehaha ASP.NET 3.5 Basics 9 May 22nd, 2008 12:51 PM
SortCommend event is being fired twice anup_daware .NET Framework 1.x 1 August 4th, 2006 05:32 AM
fired event Sorting which wasn't handled fantef ASP.NET 2.0 Basics 0 July 27th, 2006 10:05 AM
Session_Start event not fired rl ASP.NET 1.0 and 1.1 Professional 20 February 22nd, 2005 04:29 PM
DataGrid SortCommand event not fired in UserContro vskumar ASP.NET 1.x and 2.0 Application Design 2 February 17th, 2005 08:06 AM





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