0
<asp:BoundField DataField="mail" SortExpression="mail" HeaderText="Com Rec">
<HeaderStyle Font-Size="X-Small" ForeColor="White" HorizontalAlign="Left" />
<ItemStyle Font-Size="X-Small" HorizontalAlign="Left" />
</asp:BoundField>
<asp:TemplateField HeaderText="Status Change">
<ItemTemplate>
<asp:CheckBox ID="chkstatus" Width=5px runat="server" />
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:HiddenField ID="hdID" runat="server" Value='<%# eval("DATE_CREATED") %>' />
<asp:HiddenField ID="qiaid" runat="server" Value='<%# eval("ID") %>' />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
代碼背後
昏暗xitem作爲GridViewRow
Dim ID As HiddenField
For Each xitem In datagrid1.Rows
Dim rowCount As Integer
rowCount = datagrid1.Rows.Count
Dim tempvalue1 As CheckBox
'For i = 0 To (rowCount - 1)
xitem.Cells(13).Text.ToString()
tempvalue1 = DirectCast(xitem.Cells(13).FindControl("chkstatus"), CheckBox)
If tempvalue1.Checked = True Then
QIA_ID = xitem.FindControl("qiaid")
Dim strUpdate As String
strUpdate
Try
Dim cmd As DbCommand
cmd = QIA.GetSqlStringCommand(strUpdate)
QIA.ExecuteNonQuery(cmd)
Label1.Text = "Succesfylly moved to Archive"
Label1.Visible = True
End If
Next
tempcheckbox總是顯示false..please建議我
你在RowCommand事件執行的代碼? – 2011-06-07 04:36:35
嘗試Dim tempvalue1作爲CheckBox = DirectCast(xitem.FindControl(「chkstatus」),CheckBox) – 2011-06-07 04:36:50