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

推荐订阅源

量子位
宝玉的分享
宝玉的分享
Apple Machine Learning Research
Apple Machine Learning Research
阮一峰的网络日志
阮一峰的网络日志
博客园 - 司徒正美
酷 壳 – CoolShell
酷 壳 – CoolShell
IT之家
IT之家
H
Help Net Security
雷峰网
雷峰网
M
MIT News - Artificial intelligence
Microsoft Security Blog
Microsoft Security Blog
美团技术团队
GbyAI
GbyAI
博客园_首页
博客园 - 三生石上(FineUI控件)
T
Tailwind CSS Blog
I
InfoQ
小众软件
小众软件
Google DeepMind News
Google DeepMind News
D
Docker
Engineering at Meta
Engineering at Meta
WordPress大学
WordPress大学
博客园 - Franky
Hugging Face - Blog
Hugging Face - Blog

博客园 - kenly33

ORM及代码生成器和插件C#源码(最新版Kenly.DBFramework4.5.8.5) 處理RadioButtonList客戶端事件 - kenly33 - 博客园 对象关系映射架构(DBFramework)及代码生成器和插件(源码) 使對象支持自定義比較 統計分數 讀寫XML文檔 - kenly33 - 博客园 Visual Studio Team System简介 过滤某些字段重复的记录 MultiFileUploador GridViewNavigator 兩個輸入框只允許一個輸入 Gridview中梆定得RadioButton Javascript 隱藏或顯示某區域 ASP.NET 2.0中合并 GridView 的表头单元格 VS2005 RESOURCE MANAGEMENT 鲸鱼哲学 Javascript彈出對話框 FxCop Rules Atlas使用演练
Gridview梆定
kenly33 · 2007-04-20 · via 博客园 - kenly33

<asp:GridView ID="gvSupplier" runat="server" PageSize="20" AutoGenerateColumns="False" Width="100%" OnDataBound="gvSupplier_DataBound" OnRowDataBound="gvSupplier_RowDataBound" AllowPaging="True">
        <Columns>
            <asp:BoundField HeaderText="No." >
                <ItemStyle Width="30px" />
            </asp:BoundField>
            <asp:TemplateField HeaderText="Delete">
                <ItemTemplate>
                    <asp:CheckBox ID="chkDelete" runat="server"  Enabled='<%# CanDelete(Eval("IsResponsible"),Eval("HasRegistered")) %>'  Checked='<%# CanDelete(Eval("IsResponsible"),Eval("HasRegistered")) %>' Width="50px" />
                </ItemTemplate>
                <HeaderStyle Width="50px" />
            </asp:TemplateField>
            <asp:TemplateField Visible="False">
                <ItemTemplate>
                    <asp:Label ID="lblSupplierID" runat="server" Text='<%# Bind("SupplierID") %>'></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField Visible="False">
                <ItemTemplate>
                    <asp:Label ID="lblRowID" runat="server" Text='<%# Bind("RowID") %>'></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:BoundField DataField="RegisterCode" HeaderText="RegisterCode">
                <ItemStyle Width="100px" />
            </asp:BoundField>
            <asp:BoundField DataField="CNSupplierName" HeaderText="CNSupplierName" />
            <asp:BoundField DataField="ENSupplierName" HeaderText="ENSupplierName" />
            <asp:CheckBoxField DataField="IsGlobalSupplier" HeaderText="IsGlobalSupplier" />
            <asp:CheckBoxField DataField="IsActiveSupplier" HeaderText="IsActive">
                <ItemStyle Width="100px" />
            </asp:CheckBoxField>
            <asp:CheckBoxField DataField="IsResponsible" HeaderText="IsResponsible">
                <ItemStyle Width="100px" />
            </asp:CheckBoxField>
             <asp:TemplateField>
                <ItemTemplate>
                    <a href='<%# GetNavigateUrl(DataBinder.Eval(Container.DataItem, "SupplierID").ToString()) %>'>
                    Details</a>
                </ItemTemplate>
                 <ItemStyle Width="100px" />
            </asp:TemplateField>
        </Columns>
        <PagerSettings Visible="False" />
    </asp:GridView>

 public bool CanDelete(object isResponsible, object hasRegistered)
    {
        bool responsible;
        bool registered;
        bool.TryParse(isResponsible.ToString(), out responsible);
        bool.TryParse(hasRegistered.ToString(), out registered);
        return responsible & (!registered);
    }