We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback


Thread ID:




281 May 21,2002 05:30 PM UTC WinForms 0
Tags: FAQ
Asked On May 21, 2002 05:30 PM UTC

Here is what I wound up with. I think it is a simpler approach. public class SingleClickDataGrid : DataGrid { public SingleClickDataGrid() { this.MouseDown += new System.Windows.Forms.MouseEventHandler(this.GridMouseDown); } public void GridMouseDown(object sender, MouseEventArgs e) { System.Windows.Forms.DataGrid.HitTestInfo hi; // let's see where we clicked... hi = HitTest(e.X,e.Y); // If the user did not click on a cell, we don't care... // we'll just pass on to the base class if(hi.Type == System.Windows.Forms.DataGrid.HitTestType.Cell) { // Get the TableStyles collection DataGridTableStyle dgt = TableStyles[0]; // Get the ColumnStyle for the selected column DataGridColumnStyle myCol = dgt.GridColumnStyles[hi.Column]; // Is this a check box column? // if not, we'll let the base class handle it if(myCol.GetType() == typeof(DataGridBoolColumn)) { // First part of the magic... select the row, so that the edit can happen Select(hi.Row); // Call the grid table style to start and end the edit dgt.BeginEdit(myCol,hi.Row); dgt.EndEdit(myCol,hi.Row,true); } } } }


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon