Dropdown list select index change problem

Discussion in 'ASP .Net Web Controls' started by Thanigaimani thirumalai, Nov 13, 2007.

  1. 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

    *** Sent via Developersdex http://www.developersdex.com ***
    Thanigaimani thirumalai, Nov 13, 2007
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Mike
    Replies:
    1
    Views:
    796
  2. Ferd Berfel
    Replies:
    4
    Views:
    144
  3. ngoc
    Replies:
    5
    Views:
    168
    Tad McClellan
    May 11, 2006
  4. Tomasz Chmielewski

    sorting index-15, index-9, index-110 "the human way"?

    Tomasz Chmielewski, Mar 4, 2008, in forum: Perl Misc
    Replies:
    4
    Views:
    270
    Tomasz Chmielewski
    Mar 4, 2008
  5. .nLL
    Replies:
    1
    Views:
    119
    Bart Van der Donck
    Apr 27, 2008
Loading...

Share This Page