// Sets the ToolTip text for cells in the Rating column. void dataGridView1_CellFormatting(object sender, DataGridViewCellFormattingEventArgs e) { if ( (e.ColumnIndex == this.dataGridView1.Columns["Rating"].Index) && e.Value != null ) { DataGridViewCell cell = this.dataGridView1.Rows[e.RowIndex].Cells[e.ColumnIndex]; if (e.Value.Equals("*")) { cell.ToolTipText = "very bad"; } else if (e.Value.Equals("**")) { cell.ToolTipText = "bad"; } else if (e.Value.Equals("***")) { cell.ToolTipText = "good"; } else if (e.Value.Equals("****")) { cell.ToolTipText = "very good"; } } }
More Understanding Refer This : http://msdn.microsoft.com/en-us/library/2249cf0a.aspx#Y0
Join the conversation! Your thoughts help the community grow.
Sign in to leave a comment
It is the same account you read, post and publish with — and you will come straight back to this page.

Mahesh ChandPosted Jul 8, 2012, 1:10 PM
Moved blog to Windows Controls. Please select a proper category next time.