日期:2014-05-19  浏览次数:20575 次

GridView 里面如何获取boundField点击的所在行的数据,在线
<asp:GridView   ID= "GridView1 "   runat= "server "   AutoGenerateColumns= "False "   BackColor= "White "
                        BorderColor= "White "   BorderStyle= "Ridge "   BorderWidth= "2px "   CellPadding= "3 "   CellSpacing= "1 "
                        DataSourceID= "SqlDataSource1 "   GridLines= "None "   AllowPaging= "True "   OnRowCommand= "GridView1_RowCommand "   DataKeyNames= "帐号 ">
                        <FooterStyle   BackColor= "#C6C3C6 "   ForeColor= "Black "   />
                        <Columns>
                                <asp:BoundField   DataField= "帐号 "   HeaderText= "帐号 "   SortExpression= "帐号 "   />
                                <asp:BoundField   DataField= "姓名 "   HeaderText= "姓名 "   SortExpression= "姓名 "   />
                                <asp:BoundField   DataField= "身份证号 "   HeaderText= "身份证号 "   SortExpression= "身份证号 "   />
                                <asp:BoundField   DataField= "工号 "   HeaderText= "工号 "   SortExpression= "工号 "   />
                                <asp:ButtonField   CommandName= "EditRole "   Text= "配置角色 "   />
                        </Columns>
                        <RowStyle   BackColor= "#DEDFDE "   ForeColor= "Black "   />
                        <SelectedRowStyle   BackColor= "#9471DE "   Font-Bold= "True "   ForeColor= "White "   />
                        <PagerStyle   BackColor= "#C6C3C6 "   ForeColor= "Black "   HorizontalAlign= "Right "   />
                        <HeaderStyle   BackColor= "#4A3C8C "   Font-Bold= "True "   ForeColor= "#E7E7FF "   />
                </asp:GridView>

我在

        protected   void   GridView1_RowCommand(object   sender,   GridViewCommandEventArgs   e)
        {
                if   (e.CommandName   == &nb