Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / July 2007

Tip: Looking for answers? Try searching our database.

DataGridViewRow Alternate Text

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
doomsday123@gmail.com - 10 Jul 2007 17:24 GMT
I want to add alternate text like on an html image to a
DataGridViewRow. Is it possible?
Jeremy Ames - 10 Jul 2007 18:38 GMT
It is definitely possible. It just depends on how everything is setup. Can
you post some code?

>I want to add alternate text like on an html image to a
> DataGridViewRow. Is it possible?
doomsday123@gmail.com - 10 Jul 2007 19:53 GMT
> It is definitely possible. It just depends on how everything is setup. Can
> you post some code?
[quoted text clipped - 5 lines]
> >I want to add alternate text like on an html image to a
> > DataGridViewRow. Is it possible?

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.
doomsday123@gmail.com - 12 Jul 2007 20:40 GMT
Anyone know how I can get the mouseover text on the DataGridViewRows?
Mark Rae [MVP] - 12 Jul 2007 21:16 GMT
> 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...

Signature

Mark Rae
ASP.NET MVP
http://www.markrae.net

doomsday123@gmail.com - 12 Jul 2007 22:13 GMT
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.
Mark Rae [MVP] - 12 Jul 2007 22:32 GMT
>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...

Signature

Mark Rae
ASP.NET MVP
http://www.markrae.net


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.