如何理解GridView中与复选框相关的行! [英] How To Understand CheckBox Related Row in GridView!!!?

查看:107
本文介绍了如何理解GridView中与复选框相关的行!的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好
我不会英语很好
不好意思!
我里面有一个GridView CheckBox

hi all
i dont English Very Well
Excusme me!
i have one GridView inside it CheckBox

<Columns>
     <asp:TemplateField>
          <ItemTemplate>

<asp:LinkButton runat="server" CommandArgument='<%# Eval("Id_Question") %>' OnCommand="LinkButton_Click"> </asp:LinkButton>

 <asp:CheckBox ClientIDMode="Static" ID="CheckBoxItem" runat="server" Class="CheckBoxNotification"  />


 </ItemTemplate>
           </asp:TemplateField>
                </Columns>




和ServersideCode是:




and ServersideCode is :

for (int i = 0; i < GridView1.Rows.Count; i++)
     {
         CheckBox checkbox =      (CheckBox)GridView1.Rows[i].FindControl("CheckBoxItem");
         if (checkbox.Checked == true)
         {

           //I need Something like CommandArgument that indicate what CheckBox Need to Manipulate!!!

         }
     }



请非常帮助我!非常感谢



please Help Me Its Very Necessary!Thanks so much

推荐答案

将复选框的autopostbak属性设置为true;
Set autopostbak property of the checkbox to true;


这篇关于如何理解GridView中与复选框相关的行!的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆