asp.net使用DataGridTree实现下拉树的方法(2)

idropdowntree 成员
#region idropdowntree 成员
public dictionary<string, string> getchildcategory(string parentid)
{
    string where = "parentid='" + parentid + "'";
    if (string.isnullorempty(parentid))
    {
 where = "parentid is null or parentid='" + guid.empty + "'";
    }
    list<goodscategorybean> _goodscategorylist = selectlist(0, where, string.empty, false);
    if (_goodscategorylist != null && _goodscategorylist.count > 0)
    {
 dictionary<string, string> categorylist = new dictionary<string, string>();
 for (int i = 0; i < _goodscategorylist.count; i++)
 {
     categorylist.add(_goodscategorylist[i].id.tostring(), _goodscategorylist[i].gategoryname);
 }
 return categorylist;
    }//51aspx.com
    return null;
}
public interface.common.dropdowntree dropdowntree
{
    get { return new interface.common.dropdowntree(this); }
}
#endregion


页面调用代码: 类名.dropdowntree.bindtodropdownlist(下拉控件id);

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/wjzzpd.html