Example #1
0
    private void GetCategories()
    {
        cats = new CategoryController().GetCachedCategories();

        var parents = cats.FindAll(
            delegate(Category c) { return(c.ParentId >= 0); });

        if (cats != null && cats.Count > 0)
        {
            Category_List.Visible = true;


            CategoryCollection source = new CategoryController().GetTopLevelCachedCategories();
            source.Sort(
                delegate(Category c, Category c1) { return(c.Name.CompareTo(c1.Name)); });

            Categories_List.DataSource     = source;
            Categories_List.ItemDataBound += Categories_List_ItemDataBound;
            Categories_List.DataBind();
        }
        else
        {
            Category_List.Visible = false;
        }
    }
 private void ListView_OnRefreshing(object sender, EventArgs e)
 {
     Categories_List.ItemsSource = SeedList();
     Categories_List.EndRefresh();
 }