Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium


ASP .net - autowrap on datagrid not working

Posted on 2006-05-30
Medium Priority
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

ID: 16793642
The Comments textbox is named Textbox1.
LVL 29

Accepted Solution

David H.H.Lee earned 2000 total points
ID: 16818205
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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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.
Computer science students often experience many of the same frustrations when going through their engineering courses. This article presents seven tips I found useful when completing a bachelors and masters degree in computing which I believe may he…
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…

580 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