本文整理汇总了C#中GridViewSortEventArgs类的典型用法代码示例。如果您正苦于以下问题:C# GridViewSortEventArgs类的具体用法?C# GridViewSortEventArgs怎么用?C# GridViewSortEventArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
GridViewSortEventArgs类属于命名空间,在下文中一共展示了GridViewSortEventArgs类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: grdScheduleTasks_Sorting
protected void grdScheduleTasks_Sorting(object sender, GridViewSortEventArgs e)
{
if (e.SortExpression == "Insert")
{
Server.Transfer("ScheduleTask.aspx");
}
}
示例2: gv_Sorting
protected void gv_Sorting(object sender, GridViewSortEventArgs e)
{
GridView gv = (GridView)sender;
IEnumerable<ticket> sortedGroup;
if (gv.ID.Equals("gvMy")) sortedGroup = myTickets;
else sortedGroup = groupTickets;
if (Session[e.SortExpression] == null || Session[e.SortExpression].ToString().Equals("+"))
{
Session[e.SortExpression] = "-";
switch (e.SortExpression)
{
case "priority": sortedGroup = sortedGroup.OrderBy(p => p.priority1.level); break;
case "title": sortedGroup = sortedGroup.OrderBy(p => p.title); break;
case "submitted": sortedGroup = sortedGroup.OrderBy(p => p.submitted); break;
case "status": sortedGroup = sortedGroup.OrderBy(p => p.statuse.status_order); break;
default: break;
}
}
else
{
Session[e.SortExpression] = "+";
switch (e.SortExpression)
{
case "priority": sortedGroup = sortedGroup.OrderByDescending(p => p.priority1.level); break;
case "title": sortedGroup = sortedGroup.OrderByDescending(p => p.title); break;
case "submitted": sortedGroup = sortedGroup.OrderByDescending(p => p.submitted); break;
case "status": sortedGroup = sortedGroup.OrderByDescending(p => p.statuse.status_order); break;
default: break;
}
}
gv.DataSource = sortedGroup;
gv.DataBind();
}
示例3: grdCustomers_Sorting
protected void grdCustomers_Sorting(object sender, GridViewSortEventArgs e)
{
if (e.SortExpression == "Insert")
{
Response.Redirect("Customer.aspx");
}
}
示例4: GridViewQuotation_Sorting
protected void GridViewQuotation_Sorting(object sender, GridViewSortEventArgs e)
{
if (!string.IsNullOrEmpty(txtCountry.Text))
{
SqlDataSourceQuot.SelectCommand = "SELECT vw_Quotation.Quotation_Version_Id, vw_Quotation.Quotation_No, vw_Quotation.Vername,vw_Quotation.Quotation_Status_Name, vw_Quotation.code, vw_Quotation.companyname, vw_Quotation.Product_Name, vw_Quotation.Model_No, vw_Quotation.username, vw_Quotation.Quotation_OpenDate, vw_Quotation.Client_Id, vw_Quotation.fname, vw_Quotation.SalesId , quotation_country FROM vw_Quotation LEFT OUTER JOIN m_employee_accesslevel ON vw_Quotation.Access_Level_ID = m_employee_accesslevel.accesslevel_id WHERE ((m_employee_accesslevel.employee_id = @employee_id) OR (vw_Quotation.Access_Level_ID IS NULL)) AND Client_Id like @Client_Id AND SalesId like @SalesId AND ([Product_Name] LIKE '%' + @Product_Name + '%') AND ([Model_No] LIKE '%' + @Model_No + '%') AND vw_Quotation.Quotation_Version_Id in (Select quotation_id from Quotation_Target,Country Where Quotation_Target.country_id = dbo.country.country_id and country_name like '%' + @quotation_country + '%') ORDER BY vw_Quotation.Quotation_No DESC, vw_Quotation.Vername, vw_Quotation.Model_No ";
}
}
示例5: gvCatalogo_Sorting
protected void gvCatalogo_Sorting(object sender, GridViewSortEventArgs e)
{
string sortExpression = "";
if (ViewState["sortexpression"] != null)
{
sortExpression = ViewState["sortexpression"].ToString();
}
ViewState["sortexpression"] = e.SortExpression;
if (sortExpression != ViewState["sortexpression"].ToString())
{
ViewState["sortdirection"] = "asc";
}
else
{
if (ViewState["sortdirection"] == null)
{
ViewState["sortdirection"] = "asc";
}
else
{
if (ViewState["sortdirection"].ToString() == "asc")
{
ViewState["sortdirection"] = "desc";
}
else
{
ViewState["sortdirection"] = "asc";
}
}
}
gvCatalogo.PageIndex = 0;
CargarGrid();
}
示例6: GridView1_Sorting
protected void GridView1_Sorting(object sender, GridViewSortEventArgs e)
{
DataTable dataTable = GridView1.DataSource as DataTable;
string sortExpression = e.SortExpression;
string direction = string.Empty;
if (dataTable != null)
{
DataView dataView = new DataView(dataTable);
if (SortDirection == SortDirection.Descending)
{
SortDirection = SortDirection.Ascending;
direction = " ASC";
}
else
{
SortDirection = SortDirection.Descending;
direction = " DESC";
}
DataTable table = GridView1.DataSource as DataTable;
table.DefaultView.Sort = sortExpression + direction;
GridView1.DataSource = table;
GridView1.DataBind();
}
}
示例7: departmentsGrid_Sorting
protected void departmentsGrid_Sorting(object sender, GridViewSortEventArgs e)
{
// Retrieve the name of the clicked column (sort expression)
string sortExpression = e.SortExpression;
// Decide and save the new sort direction
if (sortExpression == gridSortExpression)
{
if(gridSortDirection == SortDirection.Ascending)
{
gridSortDirection = SortDirection.Descending;
}
else
{
gridSortDirection = SortDirection.Ascending;
}
}
else
{
gridSortDirection = SortDirection.Ascending;
}
// Save the new sort expression
gridSortExpression = sortExpression;
// Rebind the grid to its data source
BindGrid();
}
示例8: grdContainers_Sorting
protected void grdContainers_Sorting(object sender, GridViewSortEventArgs e)
{
try
{
if (sortingColumn != null && sortingColumn.Equals(e.SortExpression)) // if the list is already sorted by this column,
{ // toggle ascending/descending
sortAscending = !sortAscending;
}
else // else, set new column and set sorting to ascending
{
sortingColumn = e.SortExpression;
sortAscending = true; // set false because default is ascending
}
ViewState["sortingColumn"] = sortingColumn;
ViewState["sortAscending"] = sortAscending;
updateGridView();
}
catch (System.Threading.ThreadAbortException) { }
catch (Exception ex)
{
LogError.logError(ex);
Response.Redirect("../errorpages/error.aspx");
}
}
示例9: GridViewSort
public void GridViewSort(object sender, GridViewSortEventArgs e)
{
string sortExpression = e.SortExpression;
if ((this.ViewState["SortOrder"] != null) && (this.ViewState["OrderDire"] != null))
{
if (this.ViewState["SortOrder"].ToString() == sortExpression)
{
if (this.ViewState["OrderDire"].ToString() == "Desc")
{
this.ViewState["OrderDire"] = "ASC";
}
else
{
this.ViewState["OrderDire"] = "Desc";
}
}
else
{
this.ViewState["SortOrder"] = e.SortExpression;
this.ViewState["OrderDire"] = "ASC";
}
}
else
{
this.ViewState["SortOrder"] = e.SortExpression;
this.ViewState["OrderDire"] = "ASC";
}
}
示例10: grdCustomerFollowupAction_Sorting
protected void grdCustomerFollowupAction_Sorting(object sender, GridViewSortEventArgs e)
{
if (e.SortExpression == "Insert")
{
Server.Transfer("CustomerFollowupAction.aspx");
}
}
示例11: grdPaymentMethod_Sorting
protected void grdPaymentMethod_Sorting(object sender, GridViewSortEventArgs e)
{
if (e.SortExpression == "Insert")
{
Server.Transfer("PaymentMethod.aspx");
}
}
示例12: gvNominees_Sorting
protected void gvNominees_Sorting(object sender, GridViewSortEventArgs e)
{
SortDirection =
(SortDirection == SortDirection.Ascending) ? SortDirection.Descending : SortDirection.Ascending;
SortColumn = e.SortExpression;
LoadNominees();
}
示例13: grdRepresentants_Sorting
protected void grdRepresentants_Sorting(object sender, GridViewSortEventArgs e)
{
if (e.SortExpression == "Insert")
{
Server.Transfer("Representant.aspx");
}
}
示例14: GridView1_Sorting
protected void GridView1_Sorting(object sender, GridViewSortEventArgs e)
{
//var teste = from Tabela in Contexto.TB_DESENVOLVEDOR
// orderby Tabela.ID_DESENVOLVEDOR descending
// select Tabela;
switch (e.SortExpression)
{
case "ID_DESENVOLVEDOR":
{
if (((SortDirection)ViewState["TIPO_ORDENACAO"]) == SortDirection.Ascending)
{
ViewState["TIPO_ORDENACAO"] = SortDirection.Descending;
GridView1.DataSource = Contexto.TB_DESENVOLVEDOR.OrderBy(x => x.ID_DESENVOLVEDOR);
}
else
{
ViewState["TIPO_ORDENACAO"] = SortDirection.Ascending;
GridView1.DataSource = Contexto.TB_DESENVOLVEDOR.OrderByDescending(x => x.ID_DESENVOLVEDOR);
}
break;
}
case "NM_DESENVOLVEDOR":
{
if (((SortDirection)ViewState["TIPO_ORDENACAO"]) == SortDirection.Ascending)
{
ViewState["TIPO_ORDENACAO"] = SortDirection.Descending;
GridView1.DataSource = Contexto.TB_DESENVOLVEDOR.OrderBy(x => x.NM_DESENVOLVEDOR);
}
else
{
ViewState["TIPO_ORDENACAO"] = SortDirection.Ascending;
GridView1.DataSource = Contexto.TB_DESENVOLVEDOR.OrderByDescending(x => x.NM_DESENVOLVEDOR);
}
break;
}
case "NR_IDADE":
{
if (((SortDirection)ViewState["TIPO_ORDENACAO"]) == SortDirection.Ascending)
{
ViewState["TIPO_ORDENACAO"] = SortDirection.Descending;
GridView1.DataSource = Contexto.TB_DESENVOLVEDOR.OrderBy(x => x.NR_IDADE);
}
else
{
ViewState["TIPO_ORDENACAO"] = SortDirection.Ascending;
GridView1.DataSource = Contexto.TB_DESENVOLVEDOR.OrderByDescending(x => x.NR_IDADE);
}
break;
}
}
GridView1.DataBind();
}
示例15: GridView1_Sorting
protected void GridView1_Sorting(object sender, GridViewSortEventArgs e)
{
DataSet ds = getData();
DataView dataView = new DataView(ds.Tables[0]);
dataView.Sort = e.SortExpression;
GridView1.DataSource = dataView;
GridView1.DataBind();
}