无需技术,做网站,你也牛!
所有新购主机 增送数据库
操作简洁 功能强大
专业团队 资深背景
微信搜索:cn163ns
主要功能是针对微信商家公众号提供与众不同的、有针对性的营销推广服务。通过微信平台,用户可以轻松管理自己的微信各类信息,对微信公众账号进行维护、开展智能机器人、在线发优惠劵、抽奖、刮奖、派发会员卡、打造微官网、开启微团购等多种活动,对微信营销实现有效监控,极大扩展潜在客户群和实现企业的运营目标。无使用时间和功能限制
客户网站需要显示部门及员工列表,这个用ASP.net中的TreeView树形列表控件再合适不过了。但是因操作需要,客户需要每个客户名字前面的复选框换成单选按钮。如何做到呢?下面的代码可以轻松搞定。
前台页面代码:
<asp:TreeView runat="server" ID="tvAi" Font-Bold="true" ShowLines="true" EnableClientScript="true"
ShowExpandCollapse="true" ShowCheckBoxes="All"
SelectedNodeStyle-ForeColor="Azure" >
</asp:TreeView>
后台数据绑定代码:
private void BindTreeview()
{
var pk = this.GetTreeViewNodes(); // this is simply to get the records to bind into the GridView
tvAi.Nodes.Clear();
int redindex = 1;
foreach (var parentNode in pk)
{
TreeNode master = new TreeNode(parentNode.Value.ToString(), parentNode.Key.ToString());
master.ShowCheckBox = false;
tvAi.Nodes.Add(master);
var sk = this.GetSubnodesOfTheParentNodes(parentNode.Key);
foreach (var chileNode in sk)
{
TreeNode child = new TreeNode(chileNode.Value.ToString(), chileNode.Key.ToString());
child.ShowCheckBox = false;
child.Text = "<input type=radio name=rdoC" + redindex.ToString() + " value ="+chileNode.Value.ToString()+" />" + child.Text;
master.ChildNodes.Add(child);
}
redindex++;
}
}