1

我尝试了不同的方法来设置我的 gridview clumns 的宽度,但对我来说没有任何效果。有人可以指导我如何实现这一目标。我在下面包括我的代码...

谢谢。

<SharePoint:SPGridView ID="gvSearchResults" EnableViewState="true" runat="server"
                        AlternatingRowStyle-BackColor="#f4f8fd" AllowSorting="true" DataKeyNames="ID"
                        AutoGenerateColumns="false" OnSorting="gvxxxResults_Sorting" OnPageIndexChanging="gvxxxResults_PageIndexChanging">
                        <Columns>
                        <asp:HyperLinkField HeaderText="Name" DataTextField="FileLeafRef"
                                DataNavigateUrlFields="FileLeafRef" Target="_parent" DataNavigateUrlFormatString="/pp/ll/lp/llDocs/{0}"
                                ItemStyle-HorizontalAlign="Left" HeaderStyle-HorizontalAlign="Left" HeaderStyle-Wrap="false"
                                SortExpression="Name" ItemStyle-Width="50px" />
                            <asp:BoundField DataField="Home_x0020_Number" HeaderText="Home Number" NullDisplayText=" " SortExpression="Home_x0020_Number">
                                <HeaderStyle Width="150px" Wrap="false" HorizontalAlign="Left" />
                               <ItemStyle Width="150px" Wrap="false" HorizontalAlign="Left" />
                             </asp:BoundField>
                             <asp:BoundField DataField="Phone_x0020_Number" HeaderText="Phone Number" NullDisplayText=" " SortExpression="Phone_x0020_Number">
                               <HeaderStyle Width="150px" Wrap="false" HorizontalAlign="Left" />
                               <ItemStyle Width="150px" Wrap="false" HorizontalAlign="Left" />
                             </asp:BoundField>


                        </Columns>

                    </SharePoint:SPGridView>
4

1 回答 1

0

您是否尝试过使用SPBoundField控件?尝试设置SPBoundField.ControlStyle.Width属性。

于 2013-04-16T06:43:39.820 回答