Hello,
Could anyone please help me ?
I've a GridView and I'd like to insert one of the girdview's dataset field as a
row tooltip.
The grid view is declared like:
<asp:GridView ID="grdLista" runat="server" DataSourceID="sdsList"
OnRowDataBound="grdLista_RowDataBound" AllowPaging="True" AllowSorting="True"
OnDataBound="grdLista_DataBound" AutoGenerateColumns="False" PageSize="25">
<Columns>
<asp:HyperLinkField HeaderText="Col1" DataNavigateUrlFields="field1"
DataNavigateUrlFormatString="page.aspx?PPage=page1 &Id={0}"
InsertVisible="False" DataTextField="databaseField1" />
<asp:BoundField DataField="Description" Visible="false"
InsertVisible="False" ReadOnly="True"/>
</Columns>
</asp:GridView>
Now my handler:
protected void grdLista_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
e.Row.ToolTip = e.Row.Cells[1].Text;
}
}
If I change e.Row.Cells[1].Text to something like "Hello", the HTML is rendered
fine, and the tooltip is inserted (<td title="hello">).
If I remove Visible="false" from BoundField, the description, GridView show the
description column and e.Row.Cells[1].Text returns the right description data.
If I put back Visible="false", the column is not rendered, but
e.Row.Cells[1].Text returns "".
How can I read something data-bounded, but not show in GridView and use it ?
Thanks in advance,
Fernando Monteiro