Databound Textbox vs. Width property

Discussion in 'ASP .Net Web Controls' started by Arthur Dent, Feb 9, 2005.

  1. Arthur Dent

    Arthur Dent Guest

    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.
     
    Arthur Dent, Feb 9, 2005
    #1
    1. Advertising

  2. Arthur Dent

    Gold Guest

    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.
    >
    >
    >
     
    Gold, Feb 11, 2005
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. AndrewF
    Replies:
    1
    Views:
    808
    Bruce Barker
    Oct 10, 2005
  2. rodchar
    Replies:
    0
    Views:
    399
    rodchar
    Nov 26, 2007
  3. Jeff
    Replies:
    1
    Views:
    415
    Nathan Sokalski
    Oct 8, 2008
  4. Replies:
    0
    Views:
    943
  5. Manu
    Replies:
    0
    Views:
    178
Loading...

Share This Page