DetailsView edit and insert row widths

  • Thread starter Thread starter William LaMartin
  • Start date Start date
W

William LaMartin

Is there a way to increase the width of the text boxes for the DetailsView
in edit or insert mode? When I put the control in either edit or insert
mode, the text boxes to type the new text are always much smaller than the
available space in the row.
 
Is there a way to increase the width of the text boxes for the DetailsView
in edit or insert mode? When I put the control in either edit or insert
mode, the text boxes to type the new text are always much smaller than the
available space in the row.

I do not know an obvious answer to that. However, there are two
possibilities:

a) use TemplateFields instead of BoundFields. this way you precisely define
how the edit/insert template looks like so you easily add required
attributes to TextBoxes that you place in templates (I prefer this techique)
b) write a DataBound event handler with a foreach loop for DetailsView's
rows. inside a loop you check if the row contains a TextBox and set
TextBox's width to 100% (I didn't exactly tested that in your scenario but I
use this technique constantly to tweak DetailsView's apperance in other
cases, for example to remove/disable buttons of a CommandField).

If another possibility exists I would be glad to learn it.

Regards,
Wiktor Zychla
 
Changing to template fields worked fine since there is a width attribute.

Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top