asp.net gridview按钮字段工具提示 [英] asp.net gridview buttonfield tooltip

查看:74
本文介绍了asp.net gridview按钮字段工具提示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个gridview,其列是从Codebehind创建的.即

I have a gridview whose columns are created from Codebehind. i.e.

Dim Alloted As New BoundField
                Alloted.HeaderText = "Alloted"
                Alloted.DataField = "Alloted"
                GridView1.Columns.Add(Alloted)
                GridView1.Columns(1).ItemStyle.Width = 25
                GridView1.Columns(1).HeaderStyle.Width = 25
                Dim TourType As New BoundField
                TourType.HeaderText = "Tour Type"
                TourType.DataField = "TourType"
                GridView1.Columns.Add(TourType)
                GridView1.Columns(2).ItemStyle.Width = 25
                GridView1.Columns(2).HeaderStyle.Width = 25

                Dim Edit As New ButtonField
                Edit.HeaderText = "Edit"
                Edit.Text = "Edit"
                Edit.CommandName = "Edit Tour"
                Edit.ButtonType = ButtonType.Image
                Edit.ImageUrl = "~/Buttons/Edit.png"



如您所见,第三列有一个按钮字段.现在,我想将一个标准工具提示设置为编辑记录"到按钮字段.



As you can see the 3rd column has a buttonfield. Now I want to set a standard tooltip as "Edit Record" to the buttonfield. How can I do it from codebehind?

推荐答案

您可以这样尝试...

1)从后面的代码创建一个动态div,然后使用attribute.add("title",您的工具提示")
将您的工具提示添加到该div 2)将您的编辑文件添加到该div中,并将该div添加到您的网格列中.


我希望这能解决您的问题.
you can try like this...

1) create a dynamic div from code behind and add your tool tip to that div using attribute.add("title","Your tool tip")
2) add you edit file into this div and that div into your grid column.


i hope this will solve your problem.


这篇关于asp.net gridview按钮字段工具提示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆