G
Guest
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(CompanyName) 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="1px">
<asp:TableRow>
<asp:TableCell Width="500px">
<aspataGrid id="MyDataGrid" runat="server" Width="450px"
AllowPaging="True" AllowSorting="True" PageSize="5"
AutoGenerateColumns="false" DataKeyField="SupplierID"
AllowCustomPaging="True" ShowFooter="True">
<Columns>
<asp:BoundColumn Visible="False" DataField="SupplierID"
HeaderText="SupplierID">
<HeaderStyle Height="20px" Width="60px"></HeaderStyle>
</asp:BoundColumn>
<asp:BoundColumn DataField="CompanyName" ReadOnly="True" HeaderText="Company
Name">
<HeaderStyle Height="20px" Width="300px"></HeaderStyle>
</asp:BoundColumn>
exactly 300px. My problem is that one of the records fields(CompanyName) 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="1px">
<asp:TableRow>
<asp:TableCell Width="500px">
<aspataGrid id="MyDataGrid" runat="server" Width="450px"
AllowPaging="True" AllowSorting="True" PageSize="5"
AutoGenerateColumns="false" DataKeyField="SupplierID"
AllowCustomPaging="True" ShowFooter="True">
<Columns>
<asp:BoundColumn Visible="False" DataField="SupplierID"
HeaderText="SupplierID">
<HeaderStyle Height="20px" Width="60px"></HeaderStyle>
</asp:BoundColumn>
<asp:BoundColumn DataField="CompanyName" ReadOnly="True" HeaderText="Company
Name">
<HeaderStyle Height="20px" Width="300px"></HeaderStyle>
</asp:BoundColumn>