Rank: Advanced Member Groups: Member
Joined: 10/21/2009 Posts: 39
|
Hi,
If I set the width of a column to -1 to get it to autosize as per the documentation it does not work. I have my grid set at a fixed width and Scrollbars set to Both. Some columns have a fixed width and 2 columns that are next to each other have an auto width. The 1st auto width column ends up with a width of 0 and the 2nd auto width column takes up the space of both columns. Please advise on how to use auto width columns. My markup is below: <eo:Grid ID="GridReport" runat="server" Font-Names="Trebuchet MS, Calibri, Verdana" ColumnHeaderDividerImage="00050103" GridLines="Horizontal" ColumnHeaderHeight="24" FullRowMode="true" GridLineColor="220, 223, 228" BorderColor="220, 223, 228" RunningMode="Server" ItemHeight="25" AllowColumnReorder="false" Height="250px" Width="800px" AllowPaging="true" OnPageIndexChanged="GridReport_PageIndexChanged" ScrollBars="Both"> <ItemStyles> <eo:GridItemStyleSet> <ItemHoverStyle CssClass="gridHoverStyle"></ItemHoverStyle> <SelectedStyle CssClass="gridSelectedStyle"></SelectedStyle> <CellStyle CssClass="gridCellStyle"></CellStyle> <AlternatingItemStyle CssClass="gridAltItem" /> <ItemStyle CssClass="gridItemStyle"></ItemStyle> </eo:GridItemStyleSet> </ItemStyles> <%--<GoToBoxStyle CssText="BORDER-RIGHT: #7f9db9 1px solid; BORDER-TOP: #7f9db9 1px solid; BORDER-LEFT: #7f9db9 1px solid; WIDTH: 40px; BORDER-BOTTOM: #7f9db9 1px solid"> </GoToBoxStyle>--%> <ContentPaneStyle CssText="border-bottom-color:#7f9db9;border-bottom-style:solid;border-bottom-width:1px;border-left-color:#7f9db9;border-left-style:solid;border-left-width:1px;border-right-color:#7f9db9;border-right-style:solid;border-right-width:1px;border-top-color:#7f9db9;border-top-style:solid;border-top-width:1px;"> </ContentPaneStyle> <ColumnTemplates> <eo:TextBoxColumn> <TextBoxStyle CssText="BORDER-RIGHT: #7f9db9 1px solid; PADDING-RIGHT: 2px; BORDER-TOP: #7f9db9 1px solid; PADDING-LEFT: 2px; FONT-SIZE: 8.75pt; PADDING-BOTTOM: 1px; MARGIN: 0px; BORDER-LEFT: #7f9db9 1px solid; PADDING-TOP: 2px; BORDER-BOTTOM: #7f9db9 1px solid; FONT-FAMILY: Trebuchet MS"> </TextBoxStyle> </eo:TextBoxColumn> </ColumnTemplates> <ColumnHeaderStyle CssClass="gridHeaderStyle"></ColumnHeaderStyle> <ColumnHeaderHoverStyle CssClass="gridHeaderHoverStyle"></ColumnHeaderHoverStyle> <Columns> <eo:TextBoxColumn DataField="Date" HeaderText="Date" Width="100" AllowSort="true"> </eo:TextBoxColumn> <eo:TextBoxColumn DataField="TIME" HeaderText="Time" Width="80" AllowSort="true"> </eo:TextBoxColumn> <eo:TextBoxColumn DataField="BillingDescription" HeaderText="Description" Width="-1" AllowSort="true"> </eo:TextBoxColumn> <eo:TextBoxColumn DataField="Detail" HeaderText="Detail" Width="-1" AllowSort="true"> </eo:TextBoxColumn> <eo:TextBoxColumn DataField="Quantity" HeaderText="Duration" Width="80" AllowSort="true"> </eo:TextBoxColumn> <eo:TextBoxColumn DataField="Rate" Name="Rate" HeaderText="Rate" Width="60" AllowSort="true"> </eo:TextBoxColumn> <eo:TextBoxColumn DataField="Amount" Name="Amount" HeaderText="Amount" Width="80" AllowSort="true" DataFormat="{0:N2}"> </eo:TextBoxColumn> </Columns> </eo:Grid>
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,201
|
Hi,
You can not have more than one "auto-width" column. The way auto-width works is, deducting all other fixed width columns from the fixed total width, what's left is for the only "auto-width" column. If you specify multiple "auto-width" columns, then only one will be treated as such.
Thanks!
|
Rank: Advanced Member Groups: Member
Joined: 10/21/2009 Posts: 39
|
Great, thank-you for your quick response.
|