I am trying to create a web page that has a checkboxlist which I have bound to a datasource so when the page loads I can get the names of all my employees to appear in the box.
The table which supplies this information also has a field that shows whether or not the employee is at work.
I would like the checkboxlist to show a check mark placed in the box for each employee who is at work
in other words, when the page loads the checkboxlist has every employoee listed and a check mark on those employees who are in the office.
I can load the list of names fine....but I cannot get the check mark in the box.
I have a stored procedure that finds all employees who's "at work" field = 1 and I know how to code to run that stored proc... . I am thinking I just need to know where to put the code? Which Event? If I put it in the page load event it doesnt show the marks.
When I step through the code I notice the my checkboxList.Items.count = 0....
For Each liMark In chklstEMTCheckIn.Items
If liMark.Value = mintEMTID Then
liMark.Selected = True
Else
End If
Next
not sure why this is...almost like the page doesnt know how many items are in the list until its finished loading?
Any help would be great
thanks
joe
The table which supplies this information also has a field that shows whether or not the employee is at work.
I would like the checkboxlist to show a check mark placed in the box for each employee who is at work
in other words, when the page loads the checkboxlist has every employoee listed and a check mark on those employees who are in the office.
I can load the list of names fine....but I cannot get the check mark in the box.
I have a stored procedure that finds all employees who's "at work" field = 1 and I know how to code to run that stored proc... . I am thinking I just need to know where to put the code? Which Event? If I put it in the page load event it doesnt show the marks.
When I step through the code I notice the my checkboxList.Items.count = 0....
For Each liMark In chklstEMTCheckIn.Items
If liMark.Value = mintEMTID Then
liMark.Selected = True
Else
End If
Next
not sure why this is...almost like the page doesnt know how many items are in the list until its finished loading?
Any help would be great
thanks
joe