473,406 Members | 2,549 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

DataGridView CellContentClick Event

Hi,

I am using datagridview and adding the CellContentClick event programmatically as:
this.grdSrchRefillOrdBooking.CellContentClick += new DataGridViewCellEventHandler(this.grdSrchRefillOrd Booking_CellContentClick);

This is working fine.

I have onle clear button which clears the DataGridview content.
Code for Clear Row : grdSrchRefillOrdBooking.Rows.Clear();

After clearing data when I am populating the grid again on button click,rows are getting populated correctly.
When I am clicking the content of the grid, the event fired twice one after another(function that binded with cellcontentclick).

Please suggest me the way to prevent this.

Regards,
Gyanendar
Jul 8 '09 #1
2 6723
Frinavale
9,735 Expert Mod 8TB
Have you tried removing the CellContentClick handler when you clear the rows....then add it again when you repopulate it?
Jul 8 '09 #2
Thanks for the reply.

I found the solution.Actually this problem comming because handler got added every time in search Button click.
Jul 9 '09 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

8
by: Mike | last post by:
Hi all, I have a DataGridViewCheckBoxColumn as one of my columns in a DataGridView. I want this checkbox to only be checked, but not unchecked - it's used by the user to audit that they have...
0
by: Mark Carew | last post by:
Hi, I'm writing a winform app (as practice) that has as one of its features a button that reads an xml file to a datagridview. No matter what I do I get two columns instead of one. The...
0
by: Tim Cowan | last post by:
Hi, I am trying to change the row style based on the checked value of one of the columns. I am using code like this: //This code is triggered when the checked cell is clicked in the...
3
by: GrispernMix | last post by:
Imports System.Windows.Forms Imports System.Convert Imports Microsoft.VisualBasic.Financial Public Class Chapter7 Private Sub btnExit_Click(ByVal sender As System.Object, ByVal e As...
2
by: ing.Zeco | last post by:
I need usage possibility when I double click on any row in datagridview, that row must be copied in second datagridview. Any good link about that?!
0
by: SePp | last post by:
Hi all, I have three datagridviews filled by Datasets from a Database. I want to give the user the ability to enter contacts to persons which work in a company. The first datagridview is the...
4
by: Benysh | last post by:
Hi everyone. I'm having a really annoying problem I can't solve and couldn't find an answer to anywhere, let's see if you got what it takes. I have a dataGridView on a C# Windows Form. Unbound....
1
by: Alex | last post by:
Hi, I need an event to fire off when someone clicks anyplace within a DataGridView row, but whether I use CellContentClick or CellClick, the event only fires off when clicking on the text within...
2
by: hnpatel | last post by:
Hi to All, How to use mouse click event for datagridview in c# in vs2005? I m using datagridview in c# application.I had bound data in datagridview.I want to display data in textbox when i...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
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,...

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.