HighTechTalks DotNet Forums  

Dropdown list select index change problem

ASP.net Web Controls microsoft.public.dotnet.framework.aspnet.webcontrols


Discuss Dropdown list select index change problem in the ASP.net Web Controls forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
Thanigaimani thirumalai
 
Posts: n/a

Default Dropdown list select index change problem - 11-13-2007 , 06:08 AM







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,Thanigaim ani,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

*** Sent via Developersdex http://www.developersdex.com ***

Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.