Dropdown list select index change problem

  • Thread starter Thanigaimani thirumalai
  • Start date
T

Thanigaimani thirumalai

Hi

i can explain with example in simple format

my page have two type categories of employee details

1. Client

2.Customer


Client category have only one employee details. employee name as
AsleyKumar.ok

Customer category have eight employee details .employee names are
Benjamin,catreena,david,Harinath,Ramnath,Thanigaimani,veena,Xavier.

My dropdown list having 3 types of category

1 . All ( Client and Customer)

2.Client

3. Customer.

i select All category, gridview binding both data for client and
customer category employee details.Every row with checkbox

Now i checked first four employee details employee names are
AsleyKumar,Benjamin,catreena,david..

i put these checkbox values in arraylist then put in viewstate..

whenever i select dropdownlist select index change these checkbox
values are not coming properly.if not post back na checkbox values are
getting properly,incase page is post back checkbox values are coming not
properly..

see my code behind

Public Sub getselected()
Dim arrayListContactGroup As New ArrayList

If ViewState("ArrayList") IsNot Nothing Then

arrayListContactGroup = CType(ViewState("ArrayList"), ArrayList)
ViewState.Remove("ArrayList")

End If

For Each row As GridViewRow In gridview1.Rows
Dim chkselectcontacts As CheckBox = CType(row.FindControl("chksel"),
CheckBox)

Dim arraylistlabel As Label = CType(row.FindControl("contid"), Label)
If chkselectcontacts.Checked Then

If Not arrayListContactGroup.Contains(arraylistlabel.Text) Then

arrayListContactGroup.Add(arraylistlabel.Text)

End If

Else

If arrayListContactGroup.Contains(arraylistlabel.Text) Then

arrayListContactGroup.Remove(arraylistlabel.Text)

End If

End If

Next

ViewState("ArrayList") = arrayListContactGroup
End Sub

Whats problem in my code..tel me

if u know any articles same as tel me ..

Advance wishes.


Thanigaimani.thirumalai
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,812
Latest member
GracielaWa

Latest Threads

Top