asp:Repeater数据排序
来源:互联网 发布:淘宝店铺封了怎么激活 编辑:程序博客网 时间:2024/05/17 23:55
<asp:Repeater ID="rptList" runat="server" OnItemCommand="rptList_ItemCommand"
OnItemDataBound="rptList_ItemDataBound">
<HeaderTemplate>
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="msgtable">
<tr>
<th width="100px">
<asp:LinkButton ID="CardAddNo" runat="server" CommandName="CardAddNo">单号</asp:LinkButton>
</th>
<th width="60px" align="center">
<asp:LinkButton ID="CardType" runat="server" CommandName="CardType">卡类型</asp:LinkButton>
</th>
<th width="70px">
<asp:LinkButton ID="CustomerNo" runat="server" CommandName="CustomerNo">卡号</asp:LinkButton>
</th>
<th width="60px" align="center">
<asp:LinkButton ID="Name" runat="server" CommandName="Name">姓名</asp:LinkButton>
</th>
protected void rptList_ItemDataBound(object sender, RepeaterItemEventArgs e) { if (e.Item.ItemType == ListItemType.Header) { if (ViewState["id"] != null) { LinkButton lkbtnSort = (LinkButton)e.Item.FindControl(ViewState["id"].ToString().Trim()); lkbtnSort.ForeColor = System.Drawing.Color.Red; lkbtnSort.Text = ViewState["text"].ToString(); } } }
protected void rptList_ItemCommand(object source, RepeaterCommandEventArgs e) { if (e.Item.ItemType == ListItemType.Header) { LinkButton lkbtnSort = (LinkButton)e.Item.FindControl(e.CommandName.Trim()); if (ViewState[e.CommandName.Trim()] == null) { ViewState[e.CommandName.Trim()] = "ASC"; lkbtnSort.Text = lkbtnSort.Text + "▲"; } else { if (ViewState[e.CommandName.Trim()].ToString().Trim() == "ASC") { ViewState[e.CommandName.Trim()] = "DESC"; if (lkbtnSort.Text.IndexOf("▲") != -1) lkbtnSort.Text = lkbtnSort.Text.Replace("▲", "▼"); else lkbtnSort.Text = lkbtnSort.Text + "▼"; } else { ViewState[e.CommandName.Trim()] = "ASC"; if (lkbtnSort.Text.IndexOf("▼") != -1) lkbtnSort.Text = lkbtnSort.Text.Trim().Replace("▼", "▲"); else lkbtnSort.Text = lkbtnSort.Text + "▲"; } } ViewState["text"] = lkbtnSort.Text; ViewState["id"] = e.CommandName.Trim(); //数据绑定 }
- asp:Repeater数据排序
- DataList和Repeater数据排序
- Scott Mitchell 的ASP.NET 2.0数据教程之四十五::DataList和Repeater数据排序
- ASP.NET用Repeater控件显示数据
- ASP.NET用Repeater控件显示数据
- [ASP.NET]循环显示数据-Repeater
- asp.net repeater数据邦定
- Asp.net用Repeater控件显示数据
- Asp.net--数据绑定控件Repeater
- 《ASP.NET》数据的绑定—Repeater
- Scott Mitchell 的ASP.NET 2.0数据教程之四十五::DataList和Repeater数据排序(一)
- Scott Mitchell 的ASP.NET 2.0数据教程之四十五::DataList和Repeater数据排序(二)
- Scott Mitchell 的ASP.NET 2.0数据教程之四十五::DataList和Repeater数据排序(三)
- repeater 排序
- asp.net中Repeater中嵌套Repeater来显示跟外层Repeater数据相关的其他信息
- asp.net Repeater控件用法----一列数据在Repeater中每行显示固定记录方法
- [ASP] 设置数据的输出格式-使用控件Repeater
- ASP.NET Repeater绑定数据并实现分页
- MVC Ajax.BeginForm异常提交时,跳转到处理页等问的解决方法
- sql server中的 SET NOCOUNT ON 的含义
- 清除属性clear、可视区域clip、超出范围overflow、可见属性visibility
- 南邮 OJ 1069 生日聚会
- 日经社説 20150804 仮想通貨のルールづくり迫る消失事件
- asp:Repeater数据排序
- CALayer
- linux mount命令详解
- android学习之屏幕解锁
- 创建临时表,作用:插入数据,取数据,取完数据自动删除。
- 动态规划_记忆化搜索
- leetcode 084 —— Largest Rectangle in Histogram
- win8(64位)下memcache安装时报错“ failed to install service or service already installed”
- Editplus notepad++ Gedit UltraEdi对比