Results 1 to 3 of 3

Thread: preselecting items in acheckboxlist at the time of pageload

  1. #1
    Junior Member
    Join Date
    May 2008
    Answers
    15

    preselecting items in acheckboxlist at the time of pageload

    I Have two table in database(Habits, Person).
    i)Habits contain habit name,Habitid fields,
    ii) person table contain personid, personname,habit id(fk).
    one person may have many habits.so habits ids inserted with the seperation of comma(ex:habit1,habit2) in person table.
    In front end(asp.net with C#) check box list bounds habits table dynamically. when a person loggedin to edit his habits, the particular person's habits should in check mode........at the time of pageload.

    Plz help me......


  2. #2
    Junior Member
    Join Date
    Aug 2008
    Answers
    2

    Re: preselecting items in acheckboxlist at the time of pageload

    You can get habit ids for a person through a SP and store in an array or list
    then in OnDataBOund event of checkboxlist just loop through all the checkboxes and see if it's habit id matches with array items. if it does check it else leave them unchecked. that's it. Before page renders checkbox list all habit ids for a person will be checked.


  3. #3
    Junior Member
    Join Date
    May 2008
    Answers
    15

    Re: preselecting items in acheckboxlist at the time of pageload

    Its working. Thanq very much


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
About us
Applying for a job can be a stressful and frustrating experience, especially for someone who has never done it before. Considering that you are competing for the position with a at least a dozen other applicants, it is imperative that you thoroughly prepare for the job interview, in order to stand a good chance of getting hired. That's where GeekInterview can help.
Interact