How to stop triggering an event when form loads initial time?

I have a selection changed event for gridview in my C# windows application. When I loads the application this event is also invokes. I want to trigger this event only when I click on gridview .How to solve this problem.
Can anybody help?

See All Responses Below...
Message Rating
Posted on: 13/02/2014
You might have called the set current selection or something related to that in form load event .. Check that portion and let me know..

Posted on: 13/02/2014
In the form load I just assigned the values to the grid using 

gvItemList.DataSource = table;
Share this page across other social networking sites

Posted on: 13/02/2014
The easiest way is to put a boolean vaiarble as a member variable and check m_FirstTime=TRUE;

Once you checked first time , set it as FALSE.

There might also be other better methods.  But this will serve you needs..


Posted on: 13/02/2014
The assignment m_FirstTime=TRUE; should be on Form Load

Share this page across other social networking sites

Please Login to Post Your Comments
Name (Max. 100 characters)
Please post your comments here
Select Language
Attach File(Max. Size: 2 MB)
A few simple rules when posting your Comments,
  1. Please post only answers relevant to the topic of discussion.
  2. Please dont misuse this site or do not be abusive, offensive, inappropriate,harass anyone on the boards or post ads or spam. Doing so will delete your inappropriate messages and will block or delete your account on this site.