473,765 Members | 2,203 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.)
(I am using .Net 1.1)

Please help me out in this!!

Thanks,

Anup Daware
An*********@gma il.com

Aug 1 '06 #1
2 1899
Post some snippet code.
You must have it somewhere else thats why is firing twice
Patrick
"Anup" <an*********@gm ail.comwrote in message
news:11******** *************@b 28g2000cwb.goog legroups.com...
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.)
(I am using .Net 1.1)

Please help me out in this!!

Thanks,

Anup Daware
An*********@gma il.com

Aug 1 '06 #2
Got the answer to this :)
I registered the event as well as set the value of
OnSortCommand=" SortCommand.... .."
so when I removed it from properties of datagrid the problem is solved

<Thanks Patrick you pointed it correctly>

Thanx,
Anup Daware
Patrick.O.Ige wrote:
Post some snippet code.
You must have it somewhere else thats why is firing twice
Patrick
"Anup" <an*********@gm ail.comwrote in message
news:11******** *************@b 28g2000cwb.goog legroups.com...
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.)
(I am using .Net 1.1)

Please help me out in this!!

Thanks,

Anup Daware
An*********@gma il.com
Aug 8 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
4905
by: Peter Row | last post by:
Hi, I have created a user control consisting of a textbox and a separate vertical scroll bar. The textbox is filled with data. However there could be lots of data so I only fill the textbox with enough to fill the space visible without scrolling. Having set the min and max values of my separate vertical scrollbar I use that to scroll the data. So for example the textbox could be displaying 50 lines of data but in actual fact there is...
7
7774
by: | last post by:
Hello to all I'm handling the Validating event for one text box. If something is wrong in user input I show a warning message. The problem is that if I add to method the message is displayed twice (event fired twice). Without event is fired once. if(txtMSG.Length > 0) {
7
13352
by: sanjana | last post by:
hi i wanna detect if a anything is connected to the usb port I am using system.management class for tht purpose this is my code class usbdetect { public static void Main() {
4
3990
by: Seraph | last post by:
Again, I'm rather new here, so if I fail to follow any etiquette, please forgive me and let me know what I've done wrong, but I think this might interest quite a few people. One of my colleaques was endeavoring to create a custom user control to make things a bit simpler, but she noticed that her Page_Load eventhandler was firing twice. So after long hours of research and experimentation, I stumbled upon, imho, is quite the discovery. ...
1
2701
by: e | last post by:
I have an ownerdrawn listbox that paints items in various colors dependant upon whether or not it has focus, selected, etc. The code that physically paints the items is in the drawItem event, and it works... the items change colors accordingly and the end result is what I expected to get. But it feels sluggish, like it's painting redundant info or too many times, or something. So I carefully debugged the drawitem event and discovered...
2
5381
by: Simon Verona | last post by:
I have a usercontrol with code in the "leave" event which updates the final data back into a database. This works fine except if I have a default "accept" button on a form and invoke it by pressing the ENTER key on the keyboard. In this case, it would appear that whilst the code on the button is executing and therefore presumably the button actually has focus, the leave event in the user control is not fired. Should I be interfacing...
7
2811
by: tshad | last post by:
I thought I understood how the SaveViewState is working and was trying to use this (as per some code I found) to detect refreshes. It seemed to be working but I found that the SaveViewState was executing twice on load of page and can't figure out why. I was writing out to a text file in the SaveViewState event and it was writing it twice everytime a page was loaded (whether on an initial load of the page or Postback). I took out the...
0
1319
by: Daniel | last post by:
I've created a custom control including some Literal ( constructed with html markup) and an ImageButton firing event ( add a vote ). public event VoteCommandEventHandler VoteCommand; protected override void CreateChildControls() { LiteralControl ltrBeforeVote = new LiteralControl(buildMarkupBeforeVoteButton()); this.Controls.Add(ltrBeforeVote );
2
2286
by: archana | last post by:
Hi all, I am having one datagrid whose datasource i set as array. On itemcreated event i am having one counter which i have used to find out how many times item created event is fired. What i observerd is itemcreated event is fired twice than total items present in array.
0
9568
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10156
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10007
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9951
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8831
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6649
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
3924
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3531
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2805
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.