RadControls for ASP.NET Ajax 笔记(2)

 

1. RadGrid中展开的项更新(如果有一项被展开,对该项数据做了改动,此时需要更新显示)

foreach (GridDataItem item in RadGrid1.MasterTableView.Items)
           {
               if (item.Expanded)
               {
                   item.Expanded = false;
                   item.FireCommandEvent(RadGrid.ExpandCollapseCommandName, new EventArgs());
                   item.Expanded = true;
               }
           }

2. RadGrid 模板列排序

telerik:GridTemplateColumn UniqueName="NameCommandColumn" DataField="NameCommandColumn" HeaderText="NameCommandColumn"

SortExpression="NameCommandColumn" AllowFiltering="False"

ItemStyle-Width="150" HeaderStyle-Width="150" ShowSortIcon="true" >

<HeaderTemplate>Name</HeaderTemplate>

<ItemTemplate>

<asp:HyperLink ID="hlnkContactName" runat="server"></asp:HyperLink>

<asp:Label ID="lblContactName" runat="server"></asp:Label>

</ItemTemplate>

</telerik:GridTemplateColumn>

你可能感兴趣的:(asp.net)