zoukankan      html  css  js  c++  java
  • GridView模版列中根据数据动态添加RadioButtonList项

    aspx
                        <ItemTemplate>
                            
    <asp:HiddenField ID="hditem" runat="server" Value='<%# Eval("item") %>' />
                            
    <asp:RadioButtonList ID="rblidea" runat="server" RepeatDirection="Horizontal" RepeatLayout="Flow">
                                
    <asp:ListItem Value="1">同意</asp:ListItem>
                                
    <asp:ListItem Value="0">不同意</asp:ListItem>
                            
    </asp:RadioButtonList>
                        
    </ItemTemplate>

    cs:
            protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
            
    {
                
    int strid = e.Row.RowIndex;
                RadioButtonList rbliea 
    = (RadioButtonList)e.Row.FindControl("rblidea");

                Button btnSubVise 
    = (Button)e.Row.FindControl("btnSubVise");
                HtmlInputButton hReSubVise 
    = (HtmlInputButton)e.Row.FindControl("ReSubVise");

                
    if (rbliea != null)
                
    {
                    
    if (((HiddenField)e.Row.FindControl("hditem")).Value == "3")
                    
    {
                        //rbliea.Items.Insert(
    2"需客户核准");
                            rbliea.Items.Insert(2, new ListItem("需客户核准", "2"));
                        btnSubVise.Visible 
    = false;
                        hReSubVise.Visible 
    = false;
                    }

                }


            }
  • 相关阅读:
    .NET学习笔记(1)— C#学习路线图
    Huffman树压缩程序(c实现)
    selenium webdriver使用一二三
    同时装了python2和python3,pip没法使用
    NotePad++配置python开发环境(windows)
    用Sublime搭建Python开发环境(windows)
    mapbox将图层缩放到视口合适区域
    关于 FormData 和 URLSearchParams
    vue-router在新窗口打开页面
    微信小程序wx.request 请求方法
  • 原文地址:https://www.cnblogs.com/cnaspnet/p/669415.html
Copyright © 2011-2022 走看看