Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > .NET > .NET 2.0 and Visual Studio. 2005 > .NET Framework 2.0
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
.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 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
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old August 1st, 2006, 06:12 AM
Authorized User
 
Join Date: Mar 2006
Location: pune, Maharashtra, India.
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.--
Reply With Quote
  #2 (permalink)  
Old August 4th, 2006, 04:56 AM
Friend of Wrox
 
Join Date: Sep 2004
Location: , , India.
Posts: 140
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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

Reply With Quote
  #3 (permalink)  
Old August 9th, 2006, 12:19 AM
Authorized User
 
Join Date: Mar 2006
Location: pune, Maharashtra, India.
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;
Reply With Quote
Reply


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
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



All times are GMT -4. The time now is 01:21 PM.


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