DataGridViewRow Alternate Text

  • Thread starter Thread starter doomsday123
  • Start date Start date
D

doomsday123

I want to add alternate text like on an html image to a
DataGridViewRow. Is it possible?
 
It is definitely possible. It just depends on how everything is setup. Can
you post some code?
 
It is definitely possible. It just depends on how everything is setup. Can
you post some code?

Im just binding a data table to the grid. I think i need to use the
ControlAdded event of the grid to catch all the rows being added but I
dont know how to add the mouseover text to the control.
 
Anyone know how I can get the mouseover text on the DataGridViewRows?

Not sure precisely what you're trying to do - when you move the mouse over
the rows, what are you expecting to happen, exactly...?

However, the following might give you a push in the right direction:

<asp:GridView ID="MyGridView" runat="server"
OnRowDataBound="MyGridView_RowDataBound" .......>
........
</asp:GridView

protected void MyGridView_RowDataBound(object sender, GridViewRowEventArgs
e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
e.Row.Attributes.Add("onmouseover",
"this.style.backgroundColor=\"black\"");
}
}

I'm sure you can adapt it for your specific requirements...
 
I figured out how to get what I wanted. It is the tooltip that i want
and you cant put it on a row but you can put it on cells within that
row so i just loop through all the cells of that row and set the
tooltip to the same thing on each cell so it seems like the entire row
was the tooltip.
 
I figured out how to get what I wanted. It is the tooltip that i want
and you cant put it on a row but you can put it on cells within that
row so i just loop through all the cells of that row and set the
tooltip to the same thing on each cell so it seems like the entire row
was the tooltip.

Ah right. The thing to remember here is that a GridView is rendered as an
HTML table so the rows are <tr> and the cells are <td>...

Glad you got it sorted...
 
Back
Top