Click here to Skip to main content
15,895,709 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: Email Validation Pin
Abhijit Jana10-Feb-09 17:31
professionalAbhijit Jana10-Feb-09 17:31 
GeneralRe: Email Validation Pin
Sarfaraj Ahmed10-Feb-09 17:40
Sarfaraj Ahmed10-Feb-09 17:40 
AnswerRe: Email Validation Pin
N a v a n e e t h10-Feb-09 15:25
N a v a n e e t h10-Feb-09 15:25 
AnswerRe: Email Validation Pin
Ranjit Viswakumar10-Feb-09 16:11
Ranjit Viswakumar10-Feb-09 16:11 
QuestionHow to use VB.NET ASP as an interface for copying documents from a server to another server Pin
AndyASPVB10-Feb-09 11:06
AndyASPVB10-Feb-09 11:06 
AnswerRe: How to use VB.NET ASP as an interface for copying documents from a server to another server Pin
Christian Graus10-Feb-09 12:39
protectorChristian Graus10-Feb-09 12:39 
AnswerRe: How to use VB.NET ASP as an interface for copying documents from a server to another server Pin
Ranjit Viswakumar10-Feb-09 16:29
Ranjit Viswakumar10-Feb-09 16:29 
QuestionHidden CheckBoxes not holding their checked state when paging Pin
AndyASPVB10-Feb-09 10:54
AndyASPVB10-Feb-09 10:54 
Hi
I am having problem with my gridview not holding its checked state when being paged back and forth. I have used the code given below, which I found from another website. The only difference being that I am using a sqldatasource, and I changed it to rebind to my gridview as soon below. However, despite this, it is not holding the checked state.

Private Sub RememberOldValues()

Dim categoryIDList As New ArrayList()

Dim index As Integer = -1

For Each row As GridViewRow In GridView1.Rows

index = CInt(GridView1.DataKeys(row.RowIndex).Value)

Dim result As Boolean = DirectCast(row.FindControl("CheckBox1"), CheckBox).Checked

If Session(CHECKED_ITEMS) IsNot Nothing Then

categoryIDList = DirectCast(Session(CHECKED_ITEMS), ArrayList)

End If
If result Then
If Not categoryIDList.Contains(index) Then

categoryIDList.Add(index)

End If

Else

categoryIDList.Remove(index)

End If

Next

If categoryIDList IsNot Nothing AndAlso categoryIDList.Count > 0 Then

Session(CHECKED_ITEMS) = categoryIDList

End If

End Sub



Private Sub RePopulateValues()

Dim categoryIDList As ArrayList = DirectCast(Session(CHECKED_ITEMS), ArrayList)

If categoryIDList IsNot Nothing AndAlso categoryIDList.Count > 0 Then

For Each row As GridViewRow In GridView1.Rows

Dim index As Integer = CInt(GridView1.DataKeys(row.RowIndex).Value)

If categoryIDList.Contains(index) Then

Dim myCheckBox As CheckBox = DirectCast(row.FindControl("CheckBox1"), CheckBox)

myCheckBox.Checked = True

End If

Next

End If

End Sub

Protected Sub GridView1_PageIndexChanging(ByVal sender As Object, ByVal e As GridViewPageEventArgs)

RememberOldValues()

GridView1.PageIndex = e.NewPageIndex

GridView1.DataBind


RePopulateValues()

End Sub

My checkboxes are already disabled from user action because they are set by an image button I have on the gridview. Can you see what I need to change to keep the checked state when paging?

Thanks
AnswerRe: Hidden CheckBoxes not holding their checked state when paging Pin
Christian Graus10-Feb-09 12:41
protectorChristian Graus10-Feb-09 12:41 
GeneralRe: Hidden CheckBoxes not holding their checked state when paging Pin
AndyASPVB11-Feb-09 10:36
AndyASPVB11-Feb-09 10:36 
QuestionCustom Sorting an ASP GridView - Urgent Help Needed Pin
AndyASPVB10-Feb-09 10:42
AndyASPVB10-Feb-09 10:42 
QuestionBusiness Facade Implementations Pin
Member 391904910-Feb-09 8:10
Member 391904910-Feb-09 8:10 
AnswerRe: Business Facade Implementations Pin
Jon Rista10-Feb-09 9:14
Jon Rista10-Feb-09 9:14 
GeneralRe: Business Facade Implementations Pin
Member 391904910-Feb-09 19:21
Member 391904910-Feb-09 19:21 
GeneralRe: Business Facade Implementations Pin
Jon Rista11-Feb-09 5:40
Jon Rista11-Feb-09 5:40 
QuestionRE:Role selection from ASP.Net Pin
grazza2110-Feb-09 6:08
grazza2110-Feb-09 6:08 
QuestionDynamically creating and positioning dropdown lists Pin
Mohammad A Gdeisat10-Feb-09 5:57
Mohammad A Gdeisat10-Feb-09 5:57 
Questioncreate asp.net graphs.... Pin
priyareguri10-Feb-09 3:59
priyareguri10-Feb-09 3:59 
AnswerRe: create asp.net graphs.... Pin
vaghelabhavesh10-Feb-09 4:43
vaghelabhavesh10-Feb-09 4:43 
AnswerRe: create asp.net graphs.... Pin
Abhijit Jana10-Feb-09 5:06
professionalAbhijit Jana10-Feb-09 5:06 
AnswerRe: create asp.net graphs.... Pin
Jon Rista10-Feb-09 5:52
Jon Rista10-Feb-09 5:52 
QuestionI need to calculate the sum of one of the columns on crystal report - Need help Pin
Slow Learner10-Feb-09 3:57
Slow Learner10-Feb-09 3:57 
QuestionSum or Total of a column in DataGrid changes when I click on Edit Row - Need help Pin
Slow Learner10-Feb-09 3:53
Slow Learner10-Feb-09 3:53 
AnswerRe: Sum or Total of a column in DataGrid changes when I click on Edit Row - Need help Pin
Slow Learner10-Feb-09 4:24
Slow Learner10-Feb-09 4:24 
Question[newbie] Boundaries by pixel Pin
jon-8010-Feb-09 3:41
professionaljon-8010-Feb-09 3:41 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.