GridView/DropDownList/TreeView/ListBox的扩展
扩展GridView控件:
自定义分页样式。显示总记录数、每页记录数、当前页数、总页数、首页、上一页、下一页、末页和分页按钮
扩展DropDownList控件和ListBox控件- 支持分组功能(optgroup标签)
DropDownList(ListBox)控件既强大又好用。为了让它更强大、更好用,我们来写一个继承自DropDownList(ListBox)的控件。
扩展DropDownList控件和ListBox控件 - 支持分组功能(optgroup标签)
介绍
扩展DropDownList控件和ListBox控件:
通过DropDownList控件和ListBox控件的.Items.Add(ListItem item)方法,来为其添加optgroup标签,从而实现分组功能
可以导出Excel或Word
使用方法
1、设置属性:
OptionGroupValue - 用于添加DropDownList(ListBox)控件的分组项的ListItem的Value值(默认为optgroup)
2、使用DropDownList(ListBox)控件的.Items.Add(ListItem item)方法:
OptionGroupValue为默认值时:SmartDropDownList.Items.Add(new ListItem("中国", "optgroup"));