如何在Telerik Radgrid Resizable中创建单个列?

时间:2015-02-03 07:18:07

标签: telerik-grid radgrid resizable xmltable

我有以下Telerik RadGrid

<telerik:RadGrid ID="RadGrid1" runat="server" AllowPaging="true" AllowSorting="true"
PageSize="50" HeaderStyle-Height="20" ShowStatusBar="true" AllowCustomPaging="True"
OnNeedDataSource="RadGrid1_NeedDataSource" OnSortCommand="RadGrid1_SortCommand"
OnPageSizeChanged="RadGrid1_PageSizeChanged" OnPageIndexChanged="RadGrid1_PageIndexChanged"
OnItemCommand="RadGrid1_ItemCommand" OnItemDataBound="RadGrid1_ItemDataBound">
<clientsettings>
<Selecting AllowRowSelect="True" />
<Resizing EnableRealTimeResize="true" />
</clientsettings>
<exportsettings filename="list">
</exportsettings>
<mastertableview datakeynames="ID" autogeneratecolumns="false"> 
<PagerStyle AlwaysVisible="true" PagerTextFormat="{4} {5} item(s) in {1} page(s)" />
<Columns>
  <telerik:GridBoundColumn DataField="Contract" HeaderStyle-Width="20%" HeaderText="Contract Title" 
  UniqueName="Contract" SortExpression="Contract"> </telerik:GridBoundColumn>

 <telerik:GridBoundColumn DataField="Customer" HeaderStyle-Width="20%" HeaderText="Vendor"
  UniqueName="Vendor" SortExpression="Customer"> </telerik:GridBoundColumn>

 <telerik:GridBoundColumn DataField="Contractor" HeaderStyle-Width="20%" HeaderText="Contractor"
  UniqueName="Contractor" SortExpression="Contractor"></telerik:GridBoundColumn>

  **<telerik:GridBoundColumn DataField="Name" HeaderText="Service"
  UniqueName="Name" SortExpression="Name" Resizable="true"> </telerik:GridBoundColumn>**


</Columns>
</mastertableview>
</telerik:RadGrid>

我想只调整最后一列(Name)的大小。我使用Resizable="true",但它不起作用。还有其他办法吗?

1 个答案:

答案 0 :(得分:1)

您需要添加AllowColumnResize =&#34; True&#34;在RadGrid上你可以使用Resizable =&#34; False&#34;来禁用其他列的resize属性。