コード例 #1
0
    private void UpdateDataView()
    {
        lbError.Visible = false;
        DataSet ds = null;

        HyperCatalog.Business.LinkType linkType = HyperCatalog.Business.LinkType.GetByKey(linkTypeId);
        try
        {
            if (linkType != null)
            {
                ds = linkType.GetItemTypes();

                if (ds != null)
                {
                    dg.DataSource = ds;
                    Utils.InitGridSort(ref dg, false);
                    dg.DataBind();

                    dg.DisplayLayout.AllowSortingDefault = Infragistics.WebUI.UltraWebGrid.AllowSorting.No;

                    lbNoresults.Visible = false;
                    dg.Visible          = true;
                }
                else
                {
                    dg.Visible          = false;
                    lbNoresults.Visible = true;
                }
            }
        }
        finally
        {
            if (ds != null)
            {
                ds.Dispose();
            }
        }
    }