IT Community - Software Programming, Web Development and Technical Support

Tool Tip Position Problem in Asp:DataGrid

This is a discussion on Tool Tip Position Problem in Asp:DataGrid within the ASP and ASP.NET Programming forums, part of the Web Development category; Hello All, I have a datagrid with columns as Course, Method, location etc.For simplicity consider course only. Each course ...


Go Back   IT Community - Software Programming, Web Development and Technical Support > Web Development > ASP and ASP.NET Programming

Register FAQ Members List Calendar Mark Forums Read
  #1 (permalink)  
Old 03-18-2008, 07:33 AM
Sundaram Sundaram is offline
D-Web Sr.Programmer
 
Join Date: Mar 2007
Location: chennai
Posts: 117
Sundaram is on a distinguished road
Send a message via MSN to Sundaram Send a message via Yahoo to Sundaram
Default Tool Tip Position Problem in Asp:DataGrid

Hello All,
I have a datagrid with columns as Course, Method, location etc.For simplicity consider course only. Each course has its own discription stored in database. I have to show the discription as a tooltip for corresponding course. Note:- This datagrid rendered inside a <div> tag which is having scroll bar property as 'auto'.
Now the problem is that it is not showing the tool tip at correct position if i move any of the scrollbar(<div> or browser).

//----------------------
html code is follows:-


<asp:datagrid id="DGridCourse" runat="server" Width="100%" DataKeyField="CourseID">
<columns>
<asp:templatecolumn HeaderText="Course Name">
<itemtemplate>
<!-- This is the Content of the tool tip - style property is currently hidden and changed to 'visible' as soon as move comes over it-->
<div class="RegDescript" id='<%# DataBinder.Eval(Container.DataItem,"CourseID") %>' >
<%# DataBinder.Eval(Container.DataItem,"Description") %>
</div>
<div class="RegCourseName" onmousemove="DescriptionPos(document.getElementByI d('<%# DataBinder.Eval(Container.DataItem,"CourseID") %>'))"
onmouseover="openDescript(document.getElementById( '<%# DataBinder.Eval(Container.DataItem,"CourseID") %>'))"
onmouseout="closeDescript(document.getElementById( '<%# DataBinder.Eval(Container.DataItem,"CourseID") %>'))">
<%# DataBinder.Eval(Container.DataItem,"CourseName") %>
</div>
</itemtemplate>
</asp:templatecolumn>
<asp:boundcolumn DataField="Method" HeaderText="Method"></asp:boundcolumn>
</columns>
</asp:datagrid>


//-------------------

function openDescript(obj) {
obj.style.visibility = "visible";
}

function closeDescript(obj) {
obj.style.visibility = "hidden";
}

function DescriptionPos(objTip){
objTip.style.left=event.x+"px";
objTip.style.top=event.y+"px";

}
//---------------------------------------
.RegDescript {
visibility: hidden;
border: 2px solid #688EB3;
color: #003366;
background-color: #FFFFFF;
font-family:Arial,Helvetica,sans-serif;
font-size: .65em;
width: 300px;
position:absolute;
}
__________________
Regards,

Sundaram
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 03-18-2008, 07:36 AM
Mramesh Mramesh is offline
D-Web Sr.Programmer
 
Join Date: Sep 2007
Location: Chennai
Posts: 106
Mramesh is on a distinguished road
Send a message via MSN to Mramesh
Exclamation Re: Tool Tip Position Problem in Asp:DataGrid

Hi
I have nearly the same problem and I just want to know if you found any solution. Any help would be great.
__________________
M.Ramesh Kumar
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 03-18-2008, 10:35 PM
poornima poornima is offline
D-Web Sr.Programmer
 
Join Date: Dec 2007
Posts: 189
poornima is on a distinguished road
Smile Re: Tool Tip Position Problem in Asp:DataGrid

Hi,
Could try using title property of div tag.
use like this,
<asp:datagrid id="DGridCourse" runat="server" Width="100%" DataKeyField="CourseID">
<columns>
<asp:templatecolumn HeaderText="Course Name">
<itemtemplate>
<!-- This is the Content of the tool tip - style property is currently hidden and changed to 'visible' as soon as move comes over it-->
<div class="RegDescript" title='<%# DataBinder.Eval(Container.DataItem,"CourseID") %>' style="cursor: pointer">
<%# DataBinder.Eval(Container.DataItem,"Description") %>
</div>
<div class="RegCourseName" title='<%# DataBinder.Eval(Container.DataItem,"CourseID") %>' style="cursor: pointer" onmousemove="DescriptionPos(document.getElementByI d('<%# DataBinder.Eval(Container.DataItem,"CourseID") %>'))"
onmouseover="openDescript(document.getElementById( '<%# DataBinder.Eval(Container.DataItem,"CourseID") %>'))"
onmouseout="closeDescript(document.getElementById( '<%# DataBinder.Eval(Container.DataItem,"CourseID") %>'))">
<%# DataBinder.Eval(Container.DataItem,"CourseName") %>
</div>
</itemtemplate>
</asp:templatecolumn>
<asp:boundcolumn DataField="Method" HeaderText="Method"></asp:boundcolumn>
</columns>
</asp:datagrid>

This will act like tool tip.. No need to give the tooltip text in Id of Div.It wont work.Only give in title property of div...

Last edited by poornima : 03-18-2008 at 11:58 PM.
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to gain position on Yahoo Torner Yahoo 2 12-27-2007 10:18 AM
How can i set div position to screen center(in all resulotions) KiruthikaSambandam ASP and ASP.NET Programming 3 12-20-2007 04:22 AM
How do I move the scrollbar to a specific position? Pvinothkumar HTML, CSS and Javascript Coding Techniques 3 10-27-2007 12:15 AM
Describe some problem that you had with automating testing tool? devarajan.v Software Testing 1 07-27-2007 07:04 AM
Set Position of Browsers Scrollbar using Javascript ? kingmaker HTML, CSS and Javascript Coding Techniques 1 07-19-2007 12:33 AM


All times are GMT -7. The time now is 08:06 AM.


Copyright ©2004 - 2007, DiscussWeb. All Rights Reserved.

SEO by vBSEO 3.0.0