ASP .net - autowrap on datagrid not working

Posted on 2006-05-30
Last Modified: 2007-12-19
Here is my code:

<ASP:TABLE id="tblApproval" runat="server" cssclass="meetinginfo" visible="False" cellspacing="0"
                              <ASP:TABLECELL horizontalalign="Right">
                                    <ASP:LABEL id="lblApproval" runat="server"></ASP:LABEL>
                                    <ASP:DATAGRID id="dgApproval" runat="server" pagesize="15" width="75%" onitemdatabound="dgApproval_ItemDataBound"
                                          onpageindexchanged="Change_dgApproval" allowpaging="true" allowcustompaging="false" autogeneratecolumns="false"
                                          allowsorting="true" onsortcommand="Sort_dgApproval" onprerender="PreRender_dgApproval" ItemStyle-Wrap="True">
                                          <HEADERSTYLE forecolor="#FFFFFF" cssclass="dgHeader"></HEADERSTYLE>
                                          <PAGERSTYLE mode="NumericPages" HORIZONTALALIGN="Center" FORECOLOR="#FFFFFF" cssclass="dgPager"></PAGERSTYLE>
                                                <ASP:HYPERLINKCOLUMN headertext="Activity ID" datanavigateurlfield="MeetID" datanavigateurlformatstring="meetingdetail.aspx?m={0}"
                                                      datatextfield="MeetID" sortexpression="MeetID" />
                                                <ASP:BOUNDCOLUMN headertext="Location" datafield="Location" sortexpression="Location" readonly="True" />
                                                <ASP:BOUNDCOLUMN headertext="Brand" datafield="Product" sortexpression="Product" readonly="True" />
                                                <ASP:BOUNDCOLUMN headertext="Type" datafield="Type" sortexpression="Type" readonly="True" />
                                                <ASP:BOUNDCOLUMN headertext="Date" datafield="Date" dataformatstring="{0:MM/dd/yyyy}" sortexpression="Date"
                                                      readonly="True" />
                                                <ASP:BOUNDCOLUMN headertext="Territory" datafield="Territory" sortexpression="Territory" readonly="True" />
                                                <ASP:BOUNDCOLUMN headertext="Host" readonly="True" datafield="Host" sortexpression="Host" />
                                                <ASP:BOUNDCOLUMN headertext="Speaker" readonly="True" datafield="Speaker" sortexpression="Speaker" />
                                                <ASP:BOUNDCOLUMN headertext="Estimated Cost" readonly="True" datafield="Budget" DataFormatString="{0:C}"
                                                      ItemStyle-HorizontalAlign="Right" sortexpression="Budget" />
                                                <ASP:BOUNDCOLUMN headertext="Percent" readonly="True" datafield="Percent" sortexpression="Percent"
                                                      ItemStyle-HorizontalAlign="Right" DataFormatString="{0}%" />
                                                <ASP:BOUNDCOLUMN headertext="Status" datafield="Status" sortexpression="Status" readonly="True" />
                                                            <asp:TextBox id="textbox1" runat="server" TextMode="MultiLine"></asp:TextBox>
                              <ASP:TABLECELL horizontalalign="Center">
                                    <ASP:BUTTON id="btnApproval" runat="server" text="Submit" OnClick="btnApproval_Click"></ASP:BUTTON>

The problem is that the grid is too wide and I want the comments text box to appear on a separate line (in other words, to wrap).  I've tried adjusting the width of the table, and using the itemstyle-wrap property so the grid will only be as wide as the screen, but neither is working.  I can't figure how how to get the Comments textbox to appear on a separate line for each record in the datagrid.  Please let me know what I'm missing!
Question by:Kaporch

    Author Comment

    The Comments textbox is named Textbox1.
    LVL 29

    Accepted Solution

    Kaporch ,
    Try this :
    <asp:TextBox id="textbox1" runat="server" TextMode="MultiLine" Rows="5" Columns="20"></asp:TextBox>
    <asp:TextBox id="textbox1" runat="server" TextMode="MultiLine" Width="200px" Height="200px"></asp:TextBox>


    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Join & Write a Comment

    Suggested Solutions

    Title # Comments Views Activity
    Adobe Customization Wizard XI issues 26 136
    matchUp  challenge 6 37
    Add mobile access to browser application 3 108
    VBA color chart bars 12 51
    Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
    Whether you’re a college noob or a soon-to-be pro, these tips are sure to help you in your journey to becoming a programming ninja and stand out from the crowd.
    Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
    In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

    734 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    21 Experts available now in Live!

    Get 1:1 Help Now