private void BindGrid() { string sortField = LibraryGrid.Columns[LibraryGrid.SortColumnIndex].SortField; string sortDirection = LibraryGrid.SortDirection; DataTable table = GetSchoolInfoDateTable(); DataView TableView = table.DefaultView; TableView.Sort = String.Format("{0} {1}", sortField, sortDirection); LibraryGrid.DataSource = TableView; LibraryGrid.DataBind(); }
/// <summary> /// 行绑定事件 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void LibraryGrid_OnPreRowDataBound(object sender, FineUI.GridPreRowEventArgs e) { LinkButtonField lbf = LibraryGrid.FindColumn("Libraryedit") as LinkButtonField; DataRowView row = e.DataItem as DataRowView; string librarylno = row[0].ToString(); lbf.OnClientClick = WindowEdit.GetShowReference("libraryEdit.aspx?flag=edit&id=" + librarylno + "", "图书馆编辑"); LinkButtonField lbfx = LibraryGrid.FindColumn("Librarydelete") as LinkButtonField; DataRowView rowx = e.DataItem as DataRowView; string librarylnox = rowx[0].ToString(); lbfx.OnClientClick = WindowDelete.GetShowReference("../SystemSet/DeletePassword.aspx?Type=Library&id=" + librarylno + "", "图书馆删除"); }