Esempio n. 1
0
 /// <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;
 }
Esempio n. 2
0
 /// <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();
 }