2013-10-03 52 views

回答

2

设置在任DataGridViewCellDataGridViewColumn任何你想要的文字ToolTipText财产。

2

每个小区可以具有通过设置该单元的the .ToolTipText property的工具提示。事情是这样的:

// Event for formatting cells when rendering the grid 
void dataGridView1_CellFormatting(object sender, DataGridViewCellFormattingEventArgs e) 
{ 
    // Some logic for determining which cell this is in the row 
    if ((e.ColumnIndex == this.dataGridView1.Columns["SomeColumn"].Index)) 
    { 
     // Get a reference to the cell 
     DataGridViewCell cell = this.dataGridView1.Rows[e.RowIndex].Cells[e.ColumnIndex]; 

     // Set the tooltip text 
     cell.ToolTipText = "some text"; 
    } 
} 
相关问题