惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

博客园 - 【当耐特】
云风的 BLOG
云风的 BLOG
罗磊的独立博客
C
Check Point Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Blog — PlanetScale
Blog — PlanetScale
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
月光博客
月光博客
大猫的无限游戏
大猫的无限游戏
Google DeepMind News
Google DeepMind News
Engineering at Meta
Engineering at Meta
N
Netflix TechBlog - Medium
宝玉的分享
宝玉的分享
Recent Announcements
Recent Announcements
酷 壳 – CoolShell
酷 壳 – CoolShell
博客园_首页
J
Java Code Geeks
Apple Machine Learning Research
Apple Machine Learning Research
人人都是产品经理
人人都是产品经理
爱范儿
爱范儿
I
InfoQ
Hugging Face - Blog
Hugging Face - Blog
T
Tailwind CSS Blog
B
Blog RSS Feed

博客园 - *小小黄*

List<T>的Sort,Find,Exists等的使用(摘抄) JQuery常用代码1 使用Telerik控件时出现Failed to create designer 的解决方法 GridView 笔记 - *小小黄* - 博客园 Silverlight学习笔记四:如何通过自定义ComboBox实现SelectedValue Silverlight学习笔记三:如何自定义DataGrid的Header Silverlight学习笔记二(续) Silverlight学习笔记二:DataGrid 服务器端分页、排序的实现 Silverlight学习笔记一:DataGrid如何处理鼠标的滚轮事件 SQL2005快照 在ASP.NET中使用HTTP压缩 Web注册表单设计样式的研究(下) Web注册表单设计样式的研究(上) 禁用aspx页面的客户端缓存 DataGrid中没有数据时显示表头(转) 在 Windows Vista 上安裝 Reporting Services IIS7中访问Access数据库报错的解决方案 解决“无法删除文件:无法读源文件或磁盘” AjaxControlToolkit中的CalendarExtender被遮挡的解决方法
Telerik Rad 笔记 一
*小小黄* · 2009-06-25 · via 博客园 - *小小黄*

1.RadToolBar客户端实现点击确认。

RadToolBar中加入OnClientButtonClicking="clientButtonClicking"

然后在脚本中进行确认

            function clientButtonClicking(sender, args)
            {
                 if (args.get_item().get_text()=="上报")
                 {
                    if (!window.confirm("确认要上报?上报后的数据不能修改!"))
                    {
                        args.set_cancel(true);
                    }
                 }
            }

2.RadGrid在客户端实现提示

RadGrid中设置

                                <ClientSettings>
                                    <ClientEvents OnCommand="onClientButtonClicking" />
                                </ClientSettings>

加入脚本

<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">

        <script type="text/javascript">
         <!--
            function onClientButtonClicking(sender, args)
            {
                if (args.get_commandName() == "Delete")
                {
                    var grid = $find("<%= RadGrid1.ClientID %>");
                    var view = $find("<%= RadGrid1.MasterTableView.ClientID %>");
                    var items = view.get_dataItems();
                    var item = items[args.get_commandArgument()];

        //usercount必须为主键,如果usercount不是表的主键,在Grid中设置ClientDataKeyNames为复合主键。

        //如ClientDataKeyNames="id,usercount"
                    var usercount = item.getDataKeyValue("usercount");
                    if (usercount>0)
                    {
                        alert("有用户在使用该角色,不能删除。");
                        args.set_cancel(true);
                    }
                }
            }
            -->
        </script>

    </telerik:RadCodeBlock>