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;
                    }

                }


            }
  • 相关阅读:
    Thinkhphp5控制器调用的Model层的方法总结
    js数组与字符串的相互转换方法
    oop中 限制文件类型和大小
    php常用内置函数
    PHP 面向对象
    微信JSSDK开发
    PHPExcel探索之旅
    php操作Excel
    百度地图和高德地图的API视频教程
    手机号码归属地查询(免费)
  • 原文地址:https://www.cnblogs.com/cnaspnet/p/669415.html
Copyright © 2011-2022 走看看