Exemplo n.º 1
0
    public void HideExpandColumnRecursive(GridTableView tableView)
    {
        GridItem[] nestedViewItems = tableView.GetItems(GridItemType.NestedView);
        foreach (GridNestedViewItem nestedViewItem in nestedViewItems)
        {
            foreach (GridTableView nestedView in nestedViewItem.NestedTableViews)
            {
                nestedView.Style["border"] = "0";

                Button MyExpandCollapseButton = (Button)nestedView.ParentItem.FindControl("MyExpandCollapseButton");
                if (nestedView.Items.Count == 0)
                {
                    if (MyExpandCollapseButton != null)
                    {
                        MyExpandCollapseButton.Style["visibility"] = "hidden";
                    }
                    nestedViewItem.Visible = false;
                }
                else
                {
                    if (MyExpandCollapseButton != null)
                    {
                        MyExpandCollapseButton.Style.Remove("visibility");
                    }
                }

                if (nestedView.HasDetailTables)
                {
                    HideExpandColumnRecursive(nestedView);
                }
            }
        }
    }
Exemplo n.º 2
0
 public void HideExpandColumnRecursive(GridTableView tableView)
 {
     GridItem[] nestedViewItems = tableView.GetItems(GridItemType.NestedView);
     foreach (GridNestedViewItem nestedViewItem in nestedViewItems)
     {
         foreach (GridTableView nestedView in nestedViewItem.NestedTableViews)
         {
             nestedView.ParentItem.Expanded = true;
             HideExpandColumnRecursive(nestedView);
         }
     }
 }
 public void HideExpandColumnRecursive(GridTableView tableView)
 {
     thisUserPermissions.AddRange(KVSCommon.Database.User.GetAllPermissionsByID((Int32.Parse(Session["CurrentUserId"].ToString()))));
     GridItem[] nestedViewItems = tableView.GetItems(GridItemType.NestedView);
     foreach (GridNestedViewItem nestedViewItem in nestedViewItems)
     {
         foreach (GridTableView nestedView in nestedViewItem.NestedTableViews)
         {
             nestedView.ParentItem.Expanded = true;
             HideExpandColumnRecursive(nestedView);
         }
     }
 }
 public void HideExpandColumnRecursive(GridTableView tableView)
 {
     GridItem[] nestedViewItems = tableView.GetItems(GridItemType.NestedView);
     foreach (GridNestedViewItem nestedViewItem in nestedViewItems)
     {
         foreach (GridTableView nestedView in nestedViewItem.NestedTableViews)
         {
             if (nestedView.Items.Count == 0)
             {
                 TableCell cell = nestedView.ParentItem["ExpandColumn"];
                 cell.Controls[0].Visible = false;
                 nestedViewItem.Visible = false;
             }
             if (nestedView.HasDetailTables)
             {
                 HideExpandColumnRecursive(nestedView);
             }
         }
     }
 }
Exemplo n.º 5
0
 /// <summary>
 /// Checking if all the items in the GridTableView are checked in order to determine whether to check the master item
 /// </summary>
 /// <param name="nestedTableView"></param>
 /// <returns></returns>
 protected bool ShouldCheckMasterItem(GridTableView nestedTableView)
 {
     bool isChecked = true;
     int currentPageSize = nestedTableView.PageSize;
     int currentPageIndex = nestedTableView.CurrentPageIndex;
     //Resizing the table view in order to increase the performance
     nestedTableView.PageSize = int.MaxValue;
     nestedTableView.Rebind();
     foreach (GridDataItem detailItem in nestedTableView.Items)
     {
         string currentDataItem = GenerateUniqueIdentifier(detailItem);
         if (!TableViews[nestedTableView.Name].Contains(currentDataItem))
         {
             isChecked = false;
             break;
         }
     }
     nestedTableView.PageSize = currentPageSize;
     nestedTableView.CurrentPageIndex = currentPageIndex;
     nestedTableView.Rebind();
     return isChecked;
 }
Exemplo n.º 6
0
    /// <summary>
    /// According to the ckeck state of the master checkbox selects or deselects the items down in the hierarchy
    /// </summary>
    /// <param name="tableView"></param>
    /// <param name="shouldCheck"></param>
    protected void CheckItemsInTableView(GridTableView tableView, bool shouldCheck)
    {
        int currentPageSize = tableView.PageSize;
        int currentPageIndex = tableView.CurrentPageIndex;
        //Resizing the table view in order to increase the performance
        tableView.PageSize = int.MaxValue;
        tableView.Rebind();
        foreach (GridDataItem detailItem in tableView.Items)
        {
            detailItem.Selected = shouldCheck;
            (detailItem[CheckBoxTemplateColumnUniqueName].FindControl(CheckBoxId) as CheckBox).Checked = shouldCheck;
            GridTableView ownerTableView = detailItem.OwnerTableView;
            //Generates a unique identifier for the data item. This is done in order to distinguish every data item in the grid
            string dataKeyValue = GenerateUniqueIdentifier(detailItem);
            //Select or deselect the items in the current TableView
            this.SetCollectionValue(TableViews[ownerTableView.Name], dataKeyValue, shouldCheck);

            detailItem.Expanded = true;
            //If there is next level of hierarchy exist select or deselectes the items in it
            if (detailItem.ChildItem != null)
            {
                CheckItemsInTableView(detailItem.ChildItem.NestedTableViews[0], shouldCheck);
            }
        }
        tableView.PageSize = currentPageSize;
        tableView.CurrentPageIndex = currentPageIndex;
        tableView.Rebind();
    }
Exemplo n.º 7
0
 public DnnGridItem(GridTableView ownerTableView, int itemIndex, int dataSetIndex, GridItemType itemType) : base(ownerTableView, itemIndex, dataSetIndex, itemType)
 {
 }
Exemplo n.º 8
0
 public DnnGridHeaderItem(GridTableView ownerTableView, int itemIndex, int dataSetIndex) : base(ownerTableView, itemIndex, dataSetIndex)
 {
 }
        /// <summary>
        /// Localizes the given <see cref="GridTableView"/> within the <see cref="JobsGrid"/>.
        /// </summary>
        /// <param name="tableView">The table view.</param>
        private void LocalizeGridTable(GridTableView tableView)
        {
            tableView.PagerStyle.FirstPageToolTip = this.Localize("First Page.ToolTip");
            tableView.PagerStyle.PrevPageToolTip = this.Localize("Previous Page.ToolTip");
            tableView.PagerStyle.NextPageToolTip = this.Localize("Next Page.ToolTip");
            tableView.PagerStyle.LastPageToolTip = this.Localize("Last Page.ToolTip");
            tableView.PagerStyle.FirstPageText = this.Localize("First Page.Text");
            tableView.PagerStyle.PrevPageText = this.Localize("Previous Page.Text");
            tableView.PagerStyle.NextPageText = this.Localize("Next Page.Text");
            tableView.PagerStyle.LastPageText = this.Localize("Last Page.Text");
            tableView.PagerStyle.PagerTextFormat = this.Localize("Pager.Format");
            tableView.CommandItemSettings.ExportToExcelText = this.Localize("Export To Excel.ToolTip");
            tableView.CommandItemSettings.ExportToCsvText = this.Localize("Export To CSV.ToolTip");

            foreach (GridColumn column in tableView.Columns)
            {
                column.HeaderText = this.Localize(column.HeaderText);
            }
        }
 private void LocalizeDetailGridTable(GridTableView detailTableView)
 {
     this.LocalizeGridTable(detailTableView);
     detailTableView.PagerStyle.PagerTextFormat = this.Localize("DetailPager.Format");
 }