Code
SortedList<Tkey, Tvalue> sl = new SortedList<Tkey, Tvalue>();//新建sortlist实例
SortedList<string, ProfileCommon> sl = new SortedList<string, ProfileCommon>();
foreach (ProfileCommon p in mlist)//List<ProfileCommon> mlist = new List<ProfileCommon>();
{
sl.Add(p.userid, p);//add(Tkey, Tvalue)
}
GridView1.DataSource = sl.Values;//将value的集合取出 作为数据源
GridView1.DataBind();
posted on
2009-10-28 15:52
zhangbx
阅读(
63)
评论()
编辑
收藏
举报