Click here to Skip to main content
15,946,342 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Dear Experts !! am working on Railway Project,

Need Tool tip in Gridview Cell on MouseOver the Cell (M T W TH F S SU)
======================================================================

I have a column name with heading as DAYS, In that column from DATABASE Store procedure it shows as M T W TH F S SU...all these letters are in one cell.

so i need tool tip on mouse over

when user keeps the mouse on M, it must show Monday and
T as Tuesday
W as Wednesday
TH as Thursday
F as Friday
S as Saturday
SU as Sunday.

in some cells it shows M 0 W TH F S 0

if its 0(Zero)....its must show...No Train

Please help me my dear Experts.Trying a lot for this problem.

Thanks
Posted

1 solution

You need to use RowDataBound of GridView for this.

C#
protected void GridView_RowDataBound(Object sender, GridViewRowEventArgs e)
{
   DataControlRowType rtype = e.Row.RowType;
   if (rtype == DataControlRowType.DataRow && rtype != DataControlRowType.Footer
       && rtype != DataControlRowType.Separator && rtype != DataControlRowType.Header
       && rtype != DataControlRowType.Pager)
   {
      //ShowToolTip
      e.Row.ToolTip = "Show tool tip here..";
   }
}
 
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