<< Click to Display Table of Contents >> GridView - mostrando um tooltipo / hint em uma linha |
![]() ![]() ![]() |
Default.aspx
<asp:GridView ID="Grid" runat="server" OnRowDataBound="Grid_RowDataBound"></asp:GridView>
Default.aspx.cs
protected void Grid_RowDataBound(object sender, GridViewRowEventArgs e)
{
// quando montar as linhas do tipo DADOS
if (e.Row.RowType == DataControlRowType.DataRow)
{
// mostra um tooltipo (hint) contendo os detalhes
string detalhes = DataBinder.Eval(e.Row.DataItem, "ds_tarefa").ToString();
if (detalhes == String.Empty)
detalhes = " - não há detalhes -";
e.Row.Attributes.Add("Title", detalhes);
}