Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm General / February 2006

Tip: Looking for answers? Try searching our database.

Datagridview properties to test in CellContentClick or RowEnter event handlers

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
hazz - 14 Feb 2006 17:59 GMT
so that when a user clicks or double clicks on a datagridview row,
private void dataGridView1_RowEnter(object sender, DataGridViewCellEventArgs
e) {}and

private void dataGridView1_CellContentClick(object sender,
DataGridViewCellEventArgs e){}

handle any incoming events in a reliable and consistent manner.

Requirements:
1.   no actions are performed in these event handlers during the
datagridview intialization.
2.   the ability to select a single row only after the datagridview has been
initialized and displayed.
    (given dataGridView1.SelectionMode =
DataGridViewSelectionMode.FullRowSelect; )
3.  the double click event action is not pre-empted by a single event.

Thank you,   -Greg
hazz - 14 Feb 2006 20:30 GMT
ok. I want cellclick and doublecellclick.  Now I have to find out how to not
have the cellclick fire (when calling another method) and still have the
doublecellclick event fire.  -hazz

> so that when a user clicks or double clicks on a datagridview row,
> private void dataGridView1_RowEnter(object sender,
[quoted text clipped - 15 lines]
>
> Thank you,   -Greg
hazz - 15 Feb 2006 00:39 GMT
I had to use RowHeaderMouseClick and CellDoubleClick as below to get the
separation of click and doubleclick actions.
They use different Event Handlers

this.dataGridView1.CellDoubleClick += new
System.Windows.Forms.DataGridViewCellEventHandler(this.dataGridView1_CellDoubleClick);

this.dataGridView1.RowHeaderMouseClick += new
System.Windows.Forms.DataGridViewCellMouseEventHandler(this.dataGridView1_RowHeaderMouseClick);

> so that when a user clicks or double clicks on a datagridview row,
> private void dataGridView1_RowEnter(object sender,
[quoted text clipped - 15 lines]
>
> Thank you,   -Greg

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.