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.
Unfortunately, activation email could not send to your email. Please try again.

DataGrid FAQ

Thread ID:

Created:

Platform:

Replies:

9625 Jan 4,2004 11:19 PM Windows Forms 0
loading
Tags: FAQ
HayatKhan
Asked On January 4, 2004 11:19 PM

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

CONFIRMATION

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.

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.

;