Example #1
0
 /// <summary>
 /// Bind data to grid
 /// </summary>
 private void BindGridData()
 {
     ZNode.Libraries.Admin.ProductTypeAdmin prodTypeAdmin = new ZNode.Libraries.Admin.ProductTypeAdmin();
     DataSet ds = prodTypeAdmin.GetAllProductTypes(ZNodeConfigManager.SiteConfig.PortalID).ToDataSet(true);
     DataView dv = new DataView(ds.Tables[0]);
     dv.Sort = "Name";
     uxGrid.DataSource = dv;
     uxGrid.DataBind();
 }
Example #2
0
    protected void uxGrid_Sorting(object sender, GridViewSortEventArgs e)
    {
        if (IsSearchEnabled)
        {
            ZNode.Libraries.Admin.ProductTypeAdmin prodTypeAdmin = new ZNode.Libraries.Admin.ProductTypeAdmin();
            DataSet ds = prodTypeAdmin.GetProductTypeBySearchData(txtproductType.Text.Trim(), txtDescription.Text.Trim());
            uxGrid.DataSource = SortDataTable(ds, e.SortExpression, true);
            uxGrid.DataBind();
        }
        else
        {
            ZNode.Libraries.Admin.ProductTypeAdmin prodTypeAdmin = new ZNode.Libraries.Admin.ProductTypeAdmin();
            uxGrid.DataSource = SortDataTable(prodTypeAdmin.GetAllProductTypes(ZNodeConfigManager.SiteConfig.PortalID).ToDataSet(true), e.SortExpression, true);
            uxGrid.DataBind();
        }

        if (GetSortDirection() == "DESC")
        {
            e.SortDirection = SortDirection.Descending;
        }
        else
        {
            e.SortDirection = SortDirection.Ascending;
        }
    }