• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# GridViewSortEventArgs类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中GridViewSortEventArgs的典型用法代码示例。如果您正苦于以下问题:C# GridViewSortEventArgs类的具体用法?C# GridViewSortEventArgs怎么用?C# GridViewSortEventArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



GridViewSortEventArgs类属于命名空间,在下文中一共展示了GridViewSortEventArgs类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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


示例16: gvReparaciones_Sorting

 protected void gvReparaciones_Sorting(object sender, GridViewSortEventArgs e)
 {
     //if (e.SortExpression == "vehiculo.dominio") { ViewState["OrdenGvReparaciones"] = "dominio"; }
     //else if (e.SortExpression == "vehiculo.cliente.nombreCompleto") { ViewState["OrdenGvReparaciones"] = "apellido"; }
     //else if (e.SortExpression == "estadoReparacion.nombreEstado") { ViewState["OrdenGvReparaciones"] = "nombreEstado"; }
     //else if (e.SortExpression == "total") { ViewState["OrdenGvReparaciones"] = "totalMO"; }
     ViewState["OrdenGvReparaciones"] = e.SortExpression;
     cargarGrilla();
 }
开发者ID:tutinator,项目名称:fixcar,代码行数:9,代码来源:InformeReparaciones.aspx.cs


示例17: sorting

    protected void sorting(object sender, GridViewSortEventArgs e)
    {
        ISession session = DatabaseEntities.NHibernateHelper.CreateSessionFactory().OpenSession();
        ICriteria criteria = session.CreateCriteria(typeof(DatabaseEntities.User))
                                        .Add(Restrictions.Eq("CurrentCommittee", committee.ID))
                                        .AddOrder(new Order(e.SortExpression.ToString(), true));

        GridViewUsers.DataSource = criteria.List<DatabaseEntities.User>();
        GridViewUsers.DataBind();
    }
开发者ID:bashtech,项目名称:ivote-teama,代码行数:10,代码来源:committee_election_manage.aspx.cs


示例18: gvFacturas_Sorting

 protected void gvFacturas_Sorting(object sender, GridViewSortEventArgs e)
 {
     if (ViewState["dt"] != null)
     {
         DataTable dt = (DataTable)ViewState["dt"];
         dt.DefaultView.Sort = e.SortExpression + " " + cambiarSortDirection();
         gvFacturas.DataSource = dt;
         gvFacturas.DataBind();
     }
 }
开发者ID:tutinator,项目名称:fixcar,代码行数:10,代码来源:InformeFacturas.aspx.cs


示例19: GridSort

    /// <summary>
    /// This event is used to sort the contents of the grid
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    public static void GridSort(HtmlInputHidden txthdnSortOrder, GridViewSortEventArgs e, GridView grdReport, int formName, object objCollection)
    {
        string strSortDir = null;

        try
        {
            //storing the value in hidden variable
            if (txthdnSortOrder.Value.Length == 0)
            {
                txthdnSortOrder.Value = e.SortDirection.ToString();
            }

            //To reverse the sort order
            if (txthdnSortOrder.Value.Length != 0)
            {
                if (txthdnSortOrder.Value == "Ascending")
                {
                    txthdnSortOrder.Value = "Descending";
                }
                else
                {
                    txthdnSortOrder.Value = "Ascending";
                }
            }

            //checking the condition and sorting accordingly
            switch (txthdnSortOrder.Value)
            {
                case "Ascending":
                    strSortDir = "ASC";
                    break;

                case "Descending":
                    strSortDir = "DESC";
                    break;
            }

            //Appending arrow symbol to the grid header according to the sorting.
            GridSorting.AppendSortOrderImageToGridHeader(txthdnSortOrder.Value, e.SortExpression, ref grdReport);
            GridSortingEx(formName, strSortDir, e.SortExpression, ref grdReport, objCollection);

            //Add data to the GridView
            //GridSorting.MakeAccessible(grdReport);
        }
        catch (Exception ex)
        {
            //bool rethrow = ExceptionPolicy.HandleException(ex, ARSConstants.StrPerDatumUIPolicy);

            //if (rethrow)
            //    throw;

            ////Redirecting to error message page
            //HttpContext.Current.Server.Transfer(ARSConstants.StrErrorPageURL);
        }
    }
开发者ID:BInny1,项目名称:newcarsales,代码行数:60,代码来源:BizUtility.cs


示例20: adminGrid_Sorting

    protected void adminGrid_Sorting(object sender, GridViewSortEventArgs e)
    {
        SortDirection sortDirection = SortDirection.Ascending;
        string sortField = string.Empty;

        SortGridview((GridView)sender, e, out sortDirection, out sortField);
        string strSortDirection = sortDirection == SortDirection.Ascending ? "ASC" : "DESC";

        adminGrid.DataSource = UserDataAccessLayer.GetAllUsers(e.SortExpression + " " + strSortDirection);
        adminGrid.DataBind();
    }
开发者ID:CSCI540,项目名称:CSCI540,代码行数:11,代码来源:AdminContactUser.aspx.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# GridViewUpdateEventArgs类代码示例发布时间:2022-05-24
下一篇:
C# GridViewSelectEventArgs类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap