Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > Databound Textbox vs. Width property

Reply
Thread Tools

Databound Textbox vs. Width property

 
 
Arthur Dent
Guest
Posts: n/a
 
      02-09-2005
Please help...

I have a datagrid with a template column containing a databound textbox. The
textbox width is set to 100%, so it automatically fills the column.
When you type into a textbox, if you type in more than the width, it just
kind of scrolls out the end of the textbox. I am having troubles though with
longer values getting bound to the textbox. when the textbox is bound, if
the text is too long to fit in the box, instead of just cutting it off, and
text-scrolling out past the end of the textbox, it makes the textbox wide
enough to accomodate the whole text. This is wreaking havoc with my page
layout.
I tried setting the width programmatically in the code-behind file
OnItemDataBound,
I also tried setting it to a set pixel width, instead of a percent. Neither
helped.

Any ideas on how to correct this?

Thanks in advance,
- Arthur Dent.


 
Reply With Quote
 
 
 
 
Gold
Guest
Posts: n/a
 
      02-11-2005
Restrict the width of your template column to whatever you want, instead of
specifying the size for your text box.
Hope this will work,


/Thangam

"Arthur Dent" wrote:

> Please help...
>
> I have a datagrid with a template column containing a databound textbox. The
> textbox width is set to 100%, so it automatically fills the column.
> When you type into a textbox, if you type in more than the width, it just
> kind of scrolls out the end of the textbox. I am having troubles though with
> longer values getting bound to the textbox. when the textbox is bound, if
> the text is too long to fit in the box, instead of just cutting it off, and
> text-scrolling out past the end of the textbox, it makes the textbox wide
> enough to accomodate the whole text. This is wreaking havoc with my page
> layout.
> I tried setting the width programmatically in the code-behind file
> OnItemDataBound,
> I also tried setting it to a set pixel width, instead of a percent. Neither
> helped.
>
> Any ideas on how to correct this?
>
> Thanks in advance,
> - Arthur Dent.
>
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Dynamically Resize Gridview Width Property (NOT Column Width) Hartman_Ralph@Hotmail.com ASP .Net 0 06-02-2009 03:59 PM
trouble with DataCell Width and Width of Textbox Jeff ASP .Net 1 10-08-2008 04:18 AM
databound custom controls vs composite databound custom controls rodchar ASP .Net 0 11-26-2007 03:51 PM
templated databound control problem - not showing databound Manu ASP .Net Web Controls 0 05-22-2006 09:46 AM
Textbox width scaling to width of data not width of page? AndrewF ASP .Net 1 10-10-2005 04:38 PM



Advertisments