Outta My Mind

Welcome to Big K's Pub and Weblog

My Links

Harley-Davidson Motorcycles

Pike's Peak Cam

Pike's Peak Webcam

follow Big K at http://twitter.com

View Keith McLeod's profile on LinkedIn

Post Categories

Archives

Blog Stats

Golf

Music

My Links

Stuff I Read

Adding a CheckBox Control to a TableCell in Asp.Net 2.0

This is kinda weird. I'm building a web application in ASP.Net 2.0 and I want to put a CheckBox control in a TableCell object. Should be pretty straight forward. Simply create the checkbox, set its properties, and add it to the TableCell's Controls collection. I run the app and the checkbox is not showing up. What's up with that?

Stepping through the code, I can see the checkbox in the TableCell's Controls collection right after I add it, but after I set some properties on the TableCell and add it to the TableRow object, the checkbox isn't in the collection. I figured out that when I set the Text property on the TableCell to string.Empty (or any other string), that seemed to remove the control from the TableCell. Weird. So, if I don't set the Text property on the TableCell, the checkbox shows up just fine.

I guess you can't put text and controls in a TableCell?

Print | posted on Monday, January 08, 2007 9:06 PM

Feedback

No comments posted yet.

Your comment:

Title:
Name:
Email:
Website:
 
Italic Underline Blockquote Hyperlink
 
 
Please add 7 and 5 and type the answer here: