本文整理汇总了C#中System.Web.UI.WebControls.DataGridSortCommandEventArgs类的典型用法代码示例。如果您正苦于以下问题:C# DataGridSortCommandEventArgs类的具体用法?C# DataGridSortCommandEventArgs怎么用?C# DataGridSortCommandEventArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DataGridSortCommandEventArgs类属于System.Web.UI.WebControls命名空间,在下文中一共展示了DataGridSortCommandEventArgs类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Sort_Grid
protected void Sort_Grid(Object sender, DataGridSortCommandEventArgs e)
{
DataView dv = new DataView(buildGridData());
dv.Sort = e.SortExpression.ToString();
DataGrid1.DataSource = dv;
DataGrid1.DataBind();
}
示例2: Sort_Grid
protected void Sort_Grid(Object sender, DataGridSortCommandEventArgs e)
{
DataView dv = new DataView(Posts.GetPostTableList());
dv.Sort = e.SortExpression.ToString();
DataGrid1.DataSource = dv;
DataGrid1.DataBind();
}
示例3: Announcements_SortCommand
//The SortCommand event handler
public void Announcements_SortCommand(object sender, DataGridSortCommandEventArgs e)
{
//Toggle SortAscending if the column that the data was sorted by has
//been clicked again...
if (lbOrderBy.Text == e.SortExpression)
{
if (lbDesc.Text == "desc")
{
lbDesc.Text = "";
lblCurrentSort.Text = "ASC";
lbsort.Text = e.SortExpression;
}
else
{
lbDesc.Text = "desc";
lblCurrentSort.Text = "DESC";
lbsort.Text = e.SortExpression;
}
}
else
{
lbOrderBy.Text = e.SortExpression;
lbDesc.Text = "";
lblCurrentSort.Text = "ASC";
lbsort.Text = e.SortExpression;
}
BindData();
//rebind the DataGrid data
}
示例4: dgarquivo_SortCommand
protected void dgarquivo_SortCommand(object source, DataGridSortCommandEventArgs e)
{
DataTable dtFiles = null;
dtFiles = CarregarLogArquivo(hid_arquivo.Value);
SortFiles(ref dtFiles, e.SortExpression);
dgarquivo.DataSource = dtFiles;
dgarquivo.DataBind();
}
示例5: articleList_SortCommand
protected void articleList_SortCommand(object source, DataGridSortCommandEventArgs e)
{
FileInfo[] DataFiles = null;
DataFiles = CarregarListaArquivos();
SortFiles(ref DataFiles, e.SortExpression);
articleList.DataSource = DataFiles;
articleList.DataBind();
}
示例6: grdMain_SortCommand
protected void grdMain_SortCommand(object source, DataGridSortCommandEventArgs e)
{
if ((pc["ArticleListMain_Sort"] != null) && (pc["ArticleListMain_Sort"].ToString() == (string)e.SortExpression))
pc["ArticleListMain_Sort"] = (string)e.SortExpression + " DESC";
else
pc["ArticleListMain_Sort"] = (string)e.SortExpression;
pc["ArticleListMain_CurrentPage"] = "0";
Response.Redirect("../Incidents/ArticleListMain.aspx");
}
示例7: grdMain_SortCommand
protected void grdMain_SortCommand(object source, DataGridSortCommandEventArgs e)
{
if (ViewState["SelectIssue_Sort"].ToString() == e.SortExpression)
ViewState["SelectIssue_Sort"] += " DESC";
else
ViewState["SelectIssue_Sort"] = e.SortExpression;
ViewState["SelectIssue_CurrentPage"] = 0;
BindGrid();
}
示例8: GridActivities_SortCommand
protected void GridActivities_SortCommand(object source, DataGridSortCommandEventArgs e)
{
if (e == null)
{
throw new ArgumentNullException("e");
}
if (pc[keySort] == e.SortExpression)
pc[keySort] += " DESC";
else
pc[keySort] = e.SortExpression;
ViewState[keyPage] = 0;
BindGrid();
}
示例9: SortTeams_Click
protected void SortTeams_Click(object sender, DataGridSortCommandEventArgs e)
{
if (ViewState["SortExpression"] != null && ViewState["SortExpression"].ToString() == e.SortExpression)
{
ViewState["SortAscending"] = !(bool) ViewState["SortAscending"];
}
else
{
ViewState["SortAscending"] = true;
}
ViewState["SortExpression"] = e.SortExpression;
SortTeams();
}
示例10: articleList_SortCommand
protected void articleList_SortCommand(object source, DataGridSortCommandEventArgs e)
{
FileInfo[] DataFiles = null;
if (Session["DataFiles"]==null)
{
DataFiles = CarregarListaArquivos(ddlambiente.Text, ddlsistema.Text);
Session["DataFiles"] = DataFiles;
}
else
{
DataFiles = (FileInfo[]) Session["DataFiles"];
}
SortFiles(ref DataFiles, e.SortExpression);
articleList.DataSource = DataFiles;
articleList.DataBind();
}
示例11: dbStaffList_SortCommand
protected void dbStaffList_SortCommand(object source, DataGridSortCommandEventArgs e)
{
if (ViewState["sortfield"] == null)
{
ViewState["sortfield"] = e.SortExpression;
ViewState["sortdirect"] = "ASC";
}
else
{
if (ViewState["sortfield"].ToString() == e.SortExpression)
{
ViewState["sortdirect"] = (ViewState["sortdirect"].ToString() == "ASC" ? "DESC" : "ASC");
}
else
{
ViewState["sortfield"] = e.SortExpression;
ViewState["sortdirect"] = "ASC";
}
}
foreach (DataGridColumn col in dbStaffList.Columns)
{
if (col.SortExpression.ToString() == ViewState["sortfield"].ToString())
{
if (ViewState["sortdirect"].ToString() == "ASC")
{
col.HeaderText += "<img src='../../images/asc.gif' border=0/>";
col.HeaderText = col.HeaderText.Remove(col.HeaderText.IndexOf('<'));
col.HeaderText += "<img src='../../images/asc.gif' border=0/>";
}
else
{
col.HeaderText += "<img src='../../images/desc.gif' border=0/>";
col.HeaderText = col.HeaderText.Remove(col.HeaderText.IndexOf('<'));
col.HeaderText += "<img src='../../images/desc.gif' border=0/>";
}
}
else
{
col.HeaderText += "<img src='../../images/desc.gif' border=0/>";
col.HeaderText = col.HeaderText.Remove(col.HeaderText.IndexOf('<'));
}
}
BindGrid();
}
示例12: SetSort
/// <summary>
/// ��������
/// </summary>
/// <param name="SB"></param>
/// <param name="e"></param>
public void SetSort(System.Web.UI.StateBag SB, DataGridSortCommandEventArgs e)
{
if (SB["sort"] == null)
{
SB["sort"] = e.SortExpression;
SB["desc"] = "";
}
else if ((SB["sort"].ToString() + SB["desc"].ToString()).ToString() == e.SortExpression)
{
SB["sort"] = e.SortExpression;
SB["desc"] = " DESC";
}
else
{
SB["sort"] = e.SortExpression;
SB["desc"] = "";
}
}
示例13: GridItemList_SortCommand
protected void GridItemList_SortCommand(object source, DataGridSortCommandEventArgs e)
{
string sortingDirection = string.Empty;
if (sortProperty == SortDirection.Ascending)
{
sortProperty = SortDirection.Descending;
sortingDirection = "Desc";
}
else
{
sortProperty = SortDirection.Ascending;
sortingDirection = "Asc";
}
DataTable dataTable = Session["CatGroupList"] as DataTable;
DataView sortedView = new DataView(dataTable);
sortedView.Sort = e.SortExpression + " " + sortingDirection;
GridItemList.DataSource = sortedView;
GridItemList.DataBind();
}
示例14: Sort_Grid
protected void Sort_Grid(Object sender, DataGridSortCommandEventArgs e)
{
DataGrid1.Sort = e.SortExpression.ToString();
}
示例15: Sort_Grid
protected void Sort_Grid(Object sender, DataGridSortCommandEventArgs e)
{
#region 排序
TopicTypeDataGrid.Sort = e.SortExpression.ToString();
#endregion
}