当前位置: 首页>>代码示例>>C#>>正文


C# GridViewSortEventArgs类代码示例

本文整理汇总了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");
     }
 }
开发者ID:sidneylimafilho,项目名称:InfoControl,代码行数:7,代码来源:ScheduleTasks.aspx.cs

示例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();
 }
开发者ID:EdiCarlos,项目名称:MyPractices,代码行数:34,代码来源:my_issues.aspx.cs

示例3: grdCustomers_Sorting

 protected void grdCustomers_Sorting(object sender, GridViewSortEventArgs e)
 {
     if (e.SortExpression == "Insert")
     {
         Response.Redirect("Customer.aspx");
     }
 }
开发者ID:sidneylimafilho,项目名称:InfoControl,代码行数:7,代码来源:Customers.aspx.cs

示例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 ";
     }
 }
开发者ID:AdamsChao,项目名称:netdb-localdev-proj,代码行数:7,代码来源:Quotation.aspx.cs

示例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();
 }
开发者ID:JavierTMC,项目名称:ASP.NET,代码行数:33,代码来源:PrecioGranel.aspx.cs

示例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();

        }
    }
开发者ID:kevindenham,项目名称:PDQ_Web,代码行数:29,代码来源:Applications.aspx.cs

示例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();
 }
开发者ID:ArchUser,项目名称:WebsiteProject,代码行数:25,代码来源:Departments.aspx.cs

示例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");
        }
    }
开发者ID:WsuCS3750,项目名称:CCSInventory,代码行数:26,代码来源:default.aspx.cs

示例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";
     }
 }
开发者ID:SoMeTech,项目名称:SoMeRegulatory,代码行数:28,代码来源:PageSizeBll.cs

示例10: grdCustomerFollowupAction_Sorting

 protected void grdCustomerFollowupAction_Sorting(object sender, GridViewSortEventArgs e)
 {
     if (e.SortExpression == "Insert")
     {
         Server.Transfer("CustomerFollowupAction.aspx");
     }
 }
开发者ID:sidneylimafilho,项目名称:InfoControl,代码行数:7,代码来源:CustomerFollowupActions.aspx.cs

示例11: grdPaymentMethod_Sorting

 protected void grdPaymentMethod_Sorting(object sender, GridViewSortEventArgs e)
 {
     if (e.SortExpression == "Insert")
     {
         Server.Transfer("PaymentMethod.aspx");
     }
 }
开发者ID:sidneylimafilho,项目名称:InfoControl,代码行数:7,代码来源:PaymentMethods.aspx.cs

示例12: gvNominees_Sorting

 protected void gvNominees_Sorting(object sender, GridViewSortEventArgs e)
 {
     SortDirection =
             (SortDirection == SortDirection.Ascending) ? SortDirection.Descending : SortDirection.Ascending;
     SortColumn = e.SortExpression;
     LoadNominees();
 }
开发者ID:rjustesen,项目名称:Sterling,代码行数:7,代码来源:Default.aspx.cs

示例13: grdRepresentants_Sorting

 protected void grdRepresentants_Sorting(object sender, GridViewSortEventArgs e)
 {
     if (e.SortExpression == "Insert")
     {
         Server.Transfer("Representant.aspx");
     }
 }
开发者ID:sidneylimafilho,项目名称:InfoControl,代码行数:7,代码来源:Representants.aspx.cs

示例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();
    }
开发者ID:yfeitosa,项目名称:ConceitosCSharp,代码行数:59,代码来源:Simples.aspx.cs

示例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();
 }
开发者ID:yanoovoni,项目名称:Rdroid,代码行数:8,代码来源:UserManagmnent.aspx.cs


注:本文中的GridViewSortEventArgs类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。