|
-
Apr 13th, 2005, 04:43 AM
#1
Thread Starter
Lively Member
Checkbox.checked
Hi
I've added template column in my datagrid and have added checkbox in it.
while getting checkvalue from the checkbox, it is always showing checkbox.check=false , though it is checked
------------------------------------------------------
Dim dgi As DataGridItem
Dim StrpccID As String
For Each dgi In dgCTrack.Items
Dim ChkSelected As CheckBox
ChkSelected = CType(dgi.FindControl("cbpcc"), CheckBox)
If ChkSelected.Checked = True Then
StrpccID += CType(dgi.Cells(1).FindControl("lblPCCID"), Label).Text & ","
End If
Next
Session("PCCList") = StrpccID
--------------------------------------------------------
Adeel Ahmed
-
Apr 14th, 2005, 04:35 AM
#2
Thread Starter
Lively Member
How to use a checkbox in a datagrid template column
in my code the chkpcc.checked=true is showing false, though it is checked.
Private Sub btngen_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btngen.Click
Dim dgi As DataGridItem
Dim StrpccID As String
For Each dgi In dgCTrack.Items
Dim chkPCC As CheckBox
chkPCC = CType(dgi.FindControl("cbtPCC"), CheckBox)
If chkPCC.Checked = True Then
StrpccID += CType(dgi.Cells(1).FindControl("lblpccid"), Label).Text & ","
End If
Next
StrpccID = StrpccID.TrimEnd(",")
Session("PCCList") = StrpccID
Response.Redirect("newsaragencydetail.aspx")
End Sub
Adeel Ahmed
-
Apr 14th, 2005, 11:42 PM
#3
Thread Starter
Lively Member
Re: Checkbox.checked [SOLVED]
This problem was solved
on page load event ...
If Not IsPostBack Then
datagrid.bind()
end if
Adeel Ahmed
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|