Example #1
0
 /// <summary>
 /// Bind Search data
 /// </summary>
 protected void BindSearchData()
 {
     CategoryAdmin categoryAdmin = new CategoryAdmin();
     DataSet ds = categoryAdmin.GetCategoriesBySerachData(txtCategoryName.Text.Trim());
     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)
        {
            CategoryAdmin categoryAdmin = new CategoryAdmin();
            DataSet ds = categoryAdmin.GetCategoriesBySerachData(txtCategoryName.Text.Trim());
            uxGrid.DataSource = SortDataTable(ds, e.SortExpression, true);
            uxGrid.DataBind();
        }
        else
        {
            CategoryAdmin categoryAdmin = new CategoryAdmin();
            DataSet categoryList = categoryAdmin.GetAllCategories(ZNodeConfigManager.SiteConfig.PortalID).ToDataSet(true);
            uxGrid.DataSource = SortDataTable(categoryList, e.SortExpression, true);
            uxGrid.DataBind();
        }

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