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="dgApprova l_ItemData Bound"
onpageindexchanged="Change _dgApprova l" allowpaging="true" allowcustompaging="false" autogeneratecolumns="false "
allowsorting="true" onsortcommand="Sort_dgAppr oval" onprerender="PreRender_dgA pproval" ItemStyle-Wrap="True">
<HEADERSTYLE forecolor="#FFFFFF" cssclass="dgHeader"></HEAD ERSTYLE>
<PAGERSTYLE mode="NumericPages" HORIZONTALALIGN="Center" FORECOLOR="#FFFFFF" cssclass="dgPager"></PAGER STYLE>
<COLUMNS>
<ASP:HYPERLINKCOLUMN headertext="Activity ID" datanavigateurlfield="Meet ID" datanavigateurlformatstrin g="meeting detail.asp x?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:BU TTON>
</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!
<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="dgApprova
onpageindexchanged="Change
allowsorting="true" onsortcommand="Sort_dgAppr
<HEADERSTYLE forecolor="#FFFFFF" cssclass="dgHeader"></HEAD
<PAGERSTYLE mode="NumericPages" HORIZONTALALIGN="Center" FORECOLOR="#FFFFFF" cssclass="dgPager"></PAGER
<COLUMNS>
<ASP:HYPERLINKCOLUMN headertext="Activity ID" datanavigateurlfield="Meet
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
readonly="True" />
<ASP:BOUNDCOLUMN headertext="Territory" datafield="Territory" sortexpression="Territory"
<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=
<ASP:BOUNDCOLUMN headertext="Percent" readonly="True" datafield="Percent" sortexpression="Percent"
ItemStyle-HorizontalAlign=
<ASP:BOUNDCOLUMN headertext="Status" datafield="Status" sortexpression="Status" readonly="True" />
<asp:TemplateColumn>
<ItemTemplate>
<asp:TextBox id="textbox1" runat="server" TextMode="MultiLine"></asp
</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: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!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER