-
Junior Member
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......
-
Junior Member
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.
-
Junior Member
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
-
Forum Rules