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

                }


            }
  • 相关阅读:
    spring FactoryBean配置Bean
    注意使用 BTREE 复合索引各字段的 ASC/DESC 以优化 order by 查询效率
    Mysql经常使用基本命令汇总及默认账户权限与改动
    图像边缘检測--OpenCV之cvCanny函数
    HDU 1556 Color the ball 树状数组 题解
    JMeter使用记录2 -- Web測试
    C++编程
    矩阵树定理速证
    DM816x算法具体解释--之OSD
    哥尼斯堡的“七桥问题”(25分)(欧拉回路,并查集)
  • 原文地址:https://www.cnblogs.com/cnaspnet/p/669415.html
Copyright © 2011-2022 走看看