I have a datagrid and i'm trying to fix the width of one of the columns to be
exactly 300px. My problem is that one of the records fields(CompanyN ame) is
really long and has no spaces so it streches the whole datagrid accross the
screen. Has anyone else ever experienced this problem and is there any way of
fixing it. Basically my datagrid is streching to about 120% because of this
one record. Would love to work out how I can change this setting. Any
suggestions or help at all would be appreciated.
EXAMPLE CODE:
<asp:Table Width="500px" BorderWidth="1p x">
<asp:TableRow >
<asp:TableCel l Width="500px">
<asp:DataGrid id="MyDataGrid " runat="server" Width="450px"
AllowPaging="Tr ue" AllowSorting="T rue" PageSize="5"
AutoGenerateCol umns="false" DataKeyField="S upplierID"
AllowCustomPagi ng="True" ShowFooter="Tru e">
<Columns>
<asp:BoundColum n Visible="False" DataField="Supp lierID"
HeaderText="Sup plierID">
<HeaderStyle Height="20px" Width="60px"></HeaderStyle>
</asp:BoundColumn >
<asp:BoundColum n DataField="Comp anyName" ReadOnly="True" HeaderText="Com pany
Name">
<HeaderStyle Height="20px" Width="300px"></HeaderStyle>
</asp:BoundColumn >