Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Problem with tooltip
Message
 
 
À
Tous
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Titre:
Problem with tooltip
Versions des environnements
Environment:
C# 3.0
OS:
Windows XP
Network:
Windows 2003 Server
Database:
MS SQL Server
Divers
Thread ID:
01338706
Message ID:
01338706
Vues:
52
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
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform