码迷,mamicode.com
首页 > 编程语言 > 详细

fineui排序问题

时间:2017-08-30 14:12:53      阅读:166      评论:0      收藏:0      [点我收藏+]

标签:esc   ade   checkbox   private   cte   idt   box   view   bsp   

后台:

private void BindGrid()
    {

        // 1.获取当前分页数据
        DataSet dataSet = GetPagedDataTable();
        // 2.绑定到Grid
        Grid1.DataSource = dataSet.Table1();
        string sortField = this.Grid1.SortField;
        //string sortDirection = this.;
        BindGridWithSort(sortField, Grid1.SortDirection);
        Grid1.DataBind();
       

    }
    private void BindGridWithSort(string sortField, string sortDirection)

  {
      DataSet dataSet = GetPagedDataTable();

      DataTable table = dataSet.Table1();

 

    DataView view1 = table.DefaultView;

    view1.Sort = String.Format("{0} {1}", sortField, sortDirection);

 

    Grid1.DataSource = view1;

     Grid1.DataBind();

   }

 protected void Grid1_Sort(object sender, FineUI.GridSortEventArgs e)
    {

        this.Grid1.SortDirection = e.SortDirection;
        this.Grid1.SortField = e.SortField;
        this.BindGrid();
    }

前端:

 <f:Grid ID="Grid1" Title="Grid1" PageSize="15" ShowBorder="true" BoxFlex="1" AllowPaging="true" Width="470px" Height="600px"
                AllowSorting="true" OnPageIndexChange="Grid1_PageIndexChange" ShowHeader="false"
                runat="server" EnableCheckBoxSelect="True" DataKeyNames="ID,BrandCode,isshenhe,isshouquan,img,AttchFJ"
                IsDatabasePaging="true" SortField="UserCode" SortDirection="DESC" OnSort="Grid1_Sort"
                OnRowCommand="Grid1_RowCommand">

fineui排序问题

标签:esc   ade   checkbox   private   cte   idt   box   view   bsp   

原文地址:http://www.cnblogs.com/-lsf/p/7452709.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!