Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Problem with tooltip
Message
From
13/08/2008 17:17:30
 
 
To
All
General information
Forum:
ASP.NET
Category:
Other
Title:
Problem with tooltip
Environment versions
Environment:
C# 3.0
OS:
Windows XP
Network:
Windows 2003 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01338706
Message ID:
01338706
Views:
53
Hi everybody,

We have a GridView that allows editting. I have the following code to adjust the tooltip
 if (e.Row.RowType == DataControlRowType.DataRow)
            {

                DataRowView view = e.Row.DataItem as DataRowView;
                string ProgName = view["ProgName"].ToString() + " ";  
                ImageButton btnDelete = null;
                ImageButton btnEdit = null;

                if (e.Row.Cells[1].HasControls()) { btnDelete = (ImageButton)e.Row.Cells[1].Controls[0]; }

                if (e.Row.Cells[2].HasControls()) { btnEdit = (ImageButton)e.Row.Cells[2].Controls[0]; }
                if (btnDelete != null)
                {
                    btnDelete.ToolTip = "Delete " + ProgName;
                    btnDelete.Attributes.Add("onClick",
                        "var ch=confirm('Do you want to delete " +
                        ProgName + "?');if(ch==false) return false;");
                }

                if (btnEdit != null)
                {
                    btnEdit.ToolTip = "Edit " + ProgName; // May be we need to change here to Save
                }
            }
My problem is that when I'm in update mode, the button's tooltip still says Edit + ProgramName and not Save (or Update). How can I adjust the tooltip to be correct and which event should I use?

Thanks in advance.
If it's not broken, fix it until it is.


My Blog
Next
Reply
Map
View

Click here to load this message in the networking platform