Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CheckboxList DataBind and pre-checked boxes 1

Status
Not open for further replies.

XgrinderX

Programmer
Mar 27, 2001
225
US
Fairly new to ASP.NET. I have a CheckboxList that I have successfully bound to a DataTable which was generated by a stored procedure which returns several rows of data. The rows include the following fields: ID, Desc, Checked

I am binding the Desc to DataTextField and the ID to DataValueField. I cannot figure out how to use the Checked field to force the checkboxes to actually be checked when the element is rendered. Any help is appreciated!

-Greg
 
You need to bind the DatavalueField to the checked column assuming that column is a boolean or bit data type.
 
Eh? How would I then pass the ID of the checked items over for processing?
 
That first link you posted sent me in the right direction. I got it figured out now, just like you said - manually populating the list items did the trick. Data bind was of no use in this situation. Thanks so much!
 
You're welcome, glad I could help. Have had to do this many times myself.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top