CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Nov 2009
    Posts
    22

    Dynamically resizing of text box

    Hi,
    My code is

    <ItemTemplate>
    <asp:TextBox id="txtNote" TextMode="MultiLine" wrap="true" Columns="30" Rows="3" runat="server" Font-Names="Verdana" Font-Size="XX-Small"></asp:TextBox>
    </ItemTemplate>

    My constraint is that I dont want to fix the colums and rows by hardcoding.I want that it should dynamically resize itself.

  2. #2
    Join Date
    Apr 2006
    Posts
    220

    Re: Dynamically resizing of text box

    in DataBound event

    find the text box in Grid Row by

    Code:
    TextBox box = e.FindControl("txtNote") as TextBox;
    and set its new values by

    Code:
    box.Height = 50;
    box.Width = 100;

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured