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

问了多遍,高手也没解决。
有一个GridView,CheckBox是用模版列放在gridview中的,其中第一列(CheckBox)是模板列,绑定于ID,第0列是ID列是隐藏的。我想在选择checkbox时,将gridview中某一行,某一列的值取出来,赋值给几个TEXTBOX。就这么简单。

问了多次,高手也没解决。希望尽快结帖。请高手的高手帮忙,请附原代码。


我也将前台代码附上

<asp:GridView   ID= "GridView1 "   runat= "server "   AllowPaging= "True "   AutoGenerateColumns= "False "
                        BackColor= "White "   BorderColor= "#CCCCCC "   BorderStyle= "None "   BorderWidth= "1px "
                        CellPadding= "3 "   DataKeyNames= "id "   DataSourceID= "SqlDataSource2 "   Style= "border-right:   #ccccff   thin   groove;
                        border-top:   #ccccff   thin   groove;   left:   -3px;   border-left:   #ccccff   thin   groove;
                        width:   585px;   border-bottom:   #ccccff   thin   groove;   position:   relative;   top:   -13px;
                        background-color:   #e8e0ef "   Width= "315px "   OnDataBound= "GridView1_DataBound ">
                        <FooterStyle   BackColor= "White "   ForeColor= "#000066 "   />
                        <Columns>
                                <asp:BoundField   DataField= "id "   HeaderText= "id "   InsertVisible= "False "   ReadOnly= "True "
                                        SortExpression= "id "   Visible= "False "   />
                                <asp:TemplateField   HeaderText= "选择 "   SortExpression= "id ">
                                        <EditItemTemplate>
                                                <asp:Label   ID= "Label1 "   runat= "server "   Text= ' <%#   Eval( "id ")   %> '> </asp:Label>
                                        </EditItemTemplate>
                                        <ItemTemplate>
                                                <asp:CheckBox   ID= "CheckBox1 "   runat= "server "   Style= "position:   relative "   />