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

DataGrid FAQ

Thread ID:




9625 Jan 5,2004 04:19 AM UTC WinForms 0
Tags: FAQ
Asked On January 5, 2004 04:19 AM UTC

private void Mousedownhere(object sender, System.Windows.Forms.MouseEventArgs e) { DataGrid myGrid = (DataGrid) sender; System.Windows.Forms.DataGrid.HitTestInfo hti; hti = myGrid.HitTest(e.X, e.Y); string message = "You clicked "; switch (hti.Type) { case System.Windows.Forms.DataGrid.HitTestType.None : message += "the background."; break; case System.Windows.Forms.DataGrid.HitTestType.Cell : message += "cell at row " + hti.Row + ", col " + hti.Column; message += "Row Number : "+Convert.ToString(myGrid.CurrentRowIndex)+"\n\r"+ myGrid[hti.Row, hti.Column]; fscount = hti.Row; break; case System.Windows.Forms.DataGrid.HitTestType.ColumnHeader : message += "the column header for column " + hti.Column; break; case System.Windows.Forms.DataGrid.HitTestType.RowHeader : message += "the row header for row " + hti.Row; fscount = hti.Row; string cellvalue = Convert.ToString(myGrid[hti.Row,2]); // if (cellvalue==”CHINA”) MessageBox.Show("value is="+cellvalue,Convert.ToString(hti.Row)); break; //BUT IF I REMOVE THE COMMENTS FROM THE ABOVE if (cellvalue==”CHINA ”) THEN IT DOES NOT SHOW ME //THE MESSAGEBOX // WHY??????????????? } } DataGridProblem_7034.zip


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