In the code below (which is in loop – not shown!), the length of the string contained in TextBox is too long. How can I fix this? Also, is it possible to use a TextView instead of a TextBox?
TableCell tc = new TableCell();
TextBox txtBox = new TextBox();
txtBox.Text = reader.GetString(col);
// Add the control to the TableCell
tc.Controls.Add(txtBox);
// Add the TableCell to the TableRow
tr.Cells.Add(tc);
col++;
If you would rather have a text, use a
Labelinstead ofTextBox. Like that:Now, if you want to have control over the TextBox width, you can just set it: