예제 #1
0
파일: ListView.aspx.cs 프로젝트: hoku85/UDS
 /// <summary>
 /// ��ij�û����ʼ�ȡ������DataGrid
 /// </summary>
 protected void BindGrid()
 {
     UserCookie	 = Request.Cookies["Username"];
     string Username	 = UserCookie.Value.ToString();
     DocumentClass doc		  = new DocumentClass();
     SqlDataReader dr          = doc.GetDocListInClass(Int32.Parse(ClassID),Username,Int32.Parse(DisplayType));
     DataTable datatable		  = Tools.ConvertDataReaderToDataTable(dr);
     DataView source     = datatable.DefaultView;
     source.Sort      = SortBy+" "+ SortRule;
     dgDocList.DataSource	  = source;
     dgDocList.DataBind();
     //
     //			if (datatable.Rows.Count !=0)
     //			{
     //				this.lnkbtnDelete.Visible =true;
     //
     //			}
     doc	  = null;
     datatable = null;
 }
예제 #2
0
파일: ListView.aspx.cs 프로젝트: hoku85/UDS
 /// <summary>
 /// ���ż�����ָ���ֶν�������
 /// </summary>
 protected void DataGrid_Sort(Object Src, DataGridSortCommandEventArgs E)
 {
     SortRule			  = (SortRule=="Desc")?"Asc":"Desc";
     SortBy				  = E.SortExpression ;
     DocumentClass doc		  = new DocumentClass();
     DataTable datatable		  = Tools.ConvertDataReaderToDataTable(doc.GetDocListInClass(Int32.Parse(ClassID),Username,Int32.Parse(DisplayType)));
     DataView Source		  = datatable.DefaultView;
     Source.Sort			  = SortBy+" "+ SortRule;
     doc				  = null;
     dgDocList.DataSource = Source;
     dgDocList.DataBind();
 }