Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Populate ListBox and tooltip of Listbox

Posted on 2006-06-23
8
Medium Priority
?
808 Views
Last Modified: 2012-05-05
Hi,
I have a ListBox list on my web page. One of the column's data is pulled and populated in it successfully. There is one more column in the database table that i would like to display in the tooltip of ListBox.

for eg.
My database table tblProduct has 2 columns Name and description.
I have populated Name in the ListBox and I would like display description in the tool tip when user keeps his mouse pointer over one of the product names, so description should appear as a tool tip.

Please ask more questions if any clarification is required.

Thanks in advance.
0
Comment
Question by:Junior_Developer
8 Comments
 
LVL 7

Expert Comment

by:pradeepsudharsan
ID: 16968826
Use
"alt"  HTML tag

regards
pradeep
0
 

Author Comment

by:Junior_Developer
ID: 16969013
Can you please let me know how do i use it. i am a newbie  :)
0
 
LVL 5

Expert Comment

by:Collindsouza
ID: 16970261
Hi junior Developer,
Do you have to use a list box control ?? Because Tool tip ios an atriblute of the "alt"  HTML tag which is not part of the list items in a listbox control..

Can you not use a repeater control.. since its data driven.. and essentially does the same thing?

In the code behind Use the following

Bind the Repeater control to a datasource
Repeater1.datasource = // in your case its tblProduct
Repeater1.databind()

in the .aspx file use the repeater control as follows...

If you choose to use a repeater control.. than you can achieve a tool tip by doing the following

<asp:Repeater ID="Repeater1" runat="server">
 
<ItemTemplate>
<asp:HyperLink ID="HyperLink1" ToolTip='<%#DataBinder.Eval(Container.DataItem, "description")%>'
          Text='<%#DataBinder.Eval(Container.DataItem, "Name ")%>' runat="server" />
</ItemTemplate>

</asp:Repeater>

0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 

Author Comment

by:Junior_Developer
ID: 16970407
I cannot change it now. my whole project is over except for this little thing.
Let me ask you this, some how i have to show users the description of the data listed in the listbox.

My suggestion:
I would like users to click the link button and new aspx page opens up with Productname and ProductDescription.
I already have a stored procedure that gets me Productname and ProductDescription.

I think this makes it much simpler. once user sees the description in our new page he should be able to close this window

Thanks a ton
0
 
LVL 2

Expert Comment

by:naisnet
ID: 16970699
Here's another solution if the size of the dropdownlist isn't an issue:

Write your SQL query to pull data in this manner:

SELECT product_index AS productID, product_name + ' (' + product_description + ')' AS productNAME FROM xxxxx........

This will create a custom "field" called productname where you can list both name and description.

0
 

Author Comment

by:Junior_Developer
ID: 16971059
Naisnet,
this is great but this is what i did and is working great but need some more help from you.
i have created another aspx page with datagrid on it. this data grid now has all the information that i want to display.
now i would just like to click on the link button that i have created to show up this new page.
i want it to be open in a new window so that user once read it can close and be back on the same page.

Thanks i appreciate all your help in this... waiting for your response
0
 
LVL 5

Accepted Solution

by:
Collindsouza earned 2000 total points
ID: 16971724

this is much simpler.. You need to do something similar to what i suggested earlier with Repeater control.. Only this time you need to do it with the datagrid Control... in that case.. add a ASP link button to the data grid and doo the following in the aspx page in the datagrid section of the code

<asp:LinkButton ID="BtnHyperLink" onclick="<%# "Javascript:var w=window.open('ANOTHERPAGE.aspx?ID=" + DataBinder.Eval(Container.DataItem, "DATA") + "','','width=950,height=600,resizable=yes');" %>" />

NOTE:-
ANOTHERPAGE.aspx is the New page that you want to display in a popup
ID is the ID you need to pass as a query string to the new page wherein you can then retrieve the record based on this ID
DATA is what you pass to the ID as a Query string
0
 
LVL 5

Expert Comment

by:Collindsouza
ID: 16973151
Thanks mate...

As long as your problem is resolved... I'm happy..

Cheers,
Collin

0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this Article, I will provide a few tips in problem and solution manner. Opening an ASPX page in Visual studio 2003 is very slow. To make it fast, please do follow below steps:   Open the Solution/Project. Right click the ASPX file to b…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…

885 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question