Click here to Skip to main content
16,016,168 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hello,

I have a gridview control in which i place a label in item template

VB
<asp:GridView ID="gvUserDetail" runat="server" DataKeyNames="UserID_int" AutoGenerateColumns="False"
onrowdatabound="gvUserDetail_RowDataBound">
<columns>
<asp:TemplateField HeaderText="Name" ItemStyle-HorizontalAlign="Center">
 <ItemTemplate >
 <asp:Label ID="lblext" runat="server" ToolTip='<%#Eval("UserID_int")%>' Text='<%#Eval("Name") %>'></asp:Label>
 </ItemTemplate>
</asp:TemplateField>
</columns>
</asp:Gridview>


in this label i have bind a database field UserId_int in tooltip like '<%#Eval("UserID_int")%>' but i want to bind 4 to 5 fiels in one tooltip with some text so that my tooltip show like


User Id: 6
Name: xyz
Address: abc
city: delhi

Please reply how can i do this


Thanks & Regards
Srishti Gupta
Posted
Comments
ZurdoDev 15-May-13 7:01am    
You could always just combine them in SQL so that they are in one field.
srishti056 15-May-13 7:04am    
but i want to breake line also after each field

Simple try this one ..

ToolTip='<%# string.Format("{0} {1}", Eval("UserID_int"), Eval("Name"))%>'

with break line
ToolTip='<%# string.Format("User Id : {0}\nName : {1}\n", Eval("UserID_int"), Eval("Name"))%>'


All the best

..
 
Share this answer
 
v3
Comments
srishti056 21-May-13 1:05am    
thanks your solution is working but i also want to bold text means User Id and Name to be bold please help
Please create procedure like

create procedure abc_sp
as
begin
select name from xyz_tbl
end
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900