Ejemplo n.º 1
0
    /// <summary>
    /// Method to sort the grid in Ascending and Descending Order
    /// </summary>   
    protected void SortGrid()
    {
        OrderAdmin _OrderAdmin = new OrderAdmin();
        DataSet ds = _OrderAdmin.FindOrders(txtorderid.Text.Trim(), txtfirstname.Text.Trim(), txtlastname.Text.Trim(), txtcompanyname.Text.Trim(), txtaccountnumber.Text.Trim(), txtStartDate.Text.Trim(), txtEndDate.Text.Trim(), int.Parse(ListOrderStatus.SelectedValue.ToString()), ZNodeConfigManager.SiteConfig.PortalID);
        uxGrid.DataSource = ds;

        DataSet dataSet = uxGrid.DataSource as DataSet;

        DataView dataView = new DataView(dataSet.Tables[0]);

        // Apply sort filter and direction
        dataView.Sort = SortField;

        //If sortDirection is not Ascending
        if (!SortAscending)
        {
             dataView.Sort += " DESC";
        }
            uxGrid.DataSource = null;
            uxGrid.DataSource = dataView;
            uxGrid.DataBind();
    }
Ejemplo n.º 2
0
 public DataSet BindSearchData(string startdate,string EndDate)
 {
     OrderAdmin _OrderAdmin = new OrderAdmin();
     MyDataSet = _OrderAdmin.FindOrders(txtorderid.Text.Trim(), txtfirstname.Text.Trim(), txtlastname.Text.Trim(), txtcompanyname.Text.Trim(), txtaccountnumber.Text.Trim(), startdate.Trim(), EndDate.Trim(), int.Parse(ListOrderStatus.SelectedValue.ToString()), ZNodeConfigManager.SiteConfig.PortalID);
     return MyDataSet;
 }