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

            }


        }

posted on 2007-03-09 15:44 ★金★ 阅读(1154) 评论(0) 编辑 收藏

导航

<2007年3月>
25262728123
45678910
11121314151617
18192021222324
25262728293031
1234567

公告




昵称:★金★
园龄:6年1个月
粉丝:4
关注:4

搜索

 

常用链接

随笔分类

随笔档案

文章分类

友情链接

最新评论

阅读排行榜

评论排行榜

推荐排行榜