Link to home
Start Free TrialLog in
Avatar of Kaporch
Kaporch

asked on

ASP .net - autowrap on datagrid not working

Here is my code:

<ASP:TABLE id="tblApproval" runat="server" cssclass="meetinginfo" visible="False" cellspacing="0"
                        width="70%">
                        <ASP:TABLEROW>
                              <ASP:TABLECELL horizontalalign="Right">
                                    <ASP:LABEL id="lblApproval" runat="server"></ASP:LABEL>
                              </ASP:TABLECELL>
                        </ASP:TABLEROW>
                        <ASP:TABLEROW>
                              <ASP:TABLECELL>
                                    <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>
                                          <COLUMNS>
                                                <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:TemplateColumn>
                                                      <ItemTemplate>
                                                            <asp:TextBox id="textbox1" runat="server" TextMode="MultiLine"></asp:TextBox>
                                                      </ItemTemplate>
                                                </asp:TemplateColumn>
                                          </COLUMNS>
                                    </ASP:DATAGRID>
                              </ASP:TABLECELL>
                        </ASP:TABLEROW>
                        <ASP:TABLEROW>
                              <ASP:TABLECELL horizontalalign="Center">
                                    <ASP:BUTTON id="btnApproval" runat="server" text="Submit" OnClick="btnApproval_Click"></ASP:BUTTON>
                              </ASP:TABLECELL>
                        </ASP:TABLEROW>
                  </ASP:TABLE>

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!
Avatar of Kaporch
Kaporch

ASKER

The Comments textbox is named Textbox1.
ASKER CERTIFIED SOLUTION
Avatar of David H.H.Lee
David H.H.Lee
Flag of Malaysia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial