private void BuildInputFormTab(string filter)
        {
            // Show/Hide Culture column
            if (Convert.ToInt32(inputFormId) >= 0 && SessionState.Culture.Type != CultureType.Master && SessionState.User.GetOptionById((int)OptionsEnum.OPT_SHOW_CULTURE) != null)
            {
                dg.Columns.FromKey("Country").ServerOnly = (!SessionState.User.GetOptionById((int)OptionsEnum.OPT_SHOW_CULTURE).Value);
            }
            else
            {
                dg.Columns.FromKey("Country").ServerOnly = true;
            }
            if (SessionState.User.GetOptionById((int)OptionsEnum.OPT_SHOW_INHERITANCEMODE) != null)
            {
                dg.Columns.FromKey("InheritanceMethodId").ServerOnly = (!SessionState.User.GetOptionById((int)OptionsEnum.OPT_SHOW_INHERITANCEMODE).Value);
            }
            if (Convert.ToInt32(inputFormId) >= 0)
            {
                // Show/Hide Comment column
                if (SessionState.User.GetOptionById((int)OptionsEnum.OPT_SHOW_COMMENT) != null)
                {
                    dg.Columns.FromKey("Comment").ServerOnly = (!SessionState.User.GetOptionById((int)OptionsEnum.OPT_SHOW_COMMENT).Value);
                }
                InputForm inputForm = InputForm.GetByKey(Convert.ToInt32(inputFormId));
                ViewState["InputFormName"] = inputForm.Name;
                SessionState.QDETab        = "tb_" + inputFormId;

                // Show / Hide Paste button in the toolbar
                if (SessionState.Clipboard.Items.Count > 0)
                {
                    if (SessionState.Clipboard.Items.Item(0).ItemId == itemId)
                    {
                        UITools.HideToolBarButton(uwToolbar, "Paste");
                        UITools.HideToolBarSeparator(uwToolbar, "PasteSep");
                    }
                }
                else
                {
                    UITools.HideToolBarButton(uwToolbar, "Paste");
                    UITools.HideToolBarSeparator(uwToolbar, "PasteSep");
                }
            }
            else
            {
                SessionState.QDETab        = "tb_all";
                ViewState["InputFormName"] = "All attached content";
            }

            using (InputFormChunkList chunkList = InputFormChunk.GetByInputForm(itemId, Convert.ToInt32(inputFormId), SessionState.Culture.Code))
            {
                dg.DataSource = chunkList;
                Utils.InitGridSort(ref dg, false);
                dg.DataBind();
                dg.DisplayLayout.AllowSortingDefault = AllowSorting.No;
                dg.DisplayLayout.Pager.AllowPaging   = false;
            }
        }
        private void UpdateDataView()
        {
            lbError.Visible = false;

            if (SessionState.User.HasCapability(CapabilitiesEnum.EDIT_DELETE_DRAFT_CHUNKS))
            {
                UITools.ShowToolBarSeparator(uwToolbar, "DuplicateSep");
                UITools.ShowToolBarButton(uwToolbar, "Duplicate");

                /* Alternate for CR 5096(Removal of rejection functionality)--start
                 * UITools.ShowToolBarSeparator(uwToolbar, "RejectSep");
                 * UITools.ShowToolBarButton(uwToolbar, "Reject"); */
                UITools.ShowToolBarSeparator(uwToolbar, "ilbSep");
                UITools.ShowToolBarButton(uwToolbar, "ilb");
                // Alternate for CR 5096(Removal of rejection functionality)--end
            }
            else
            {
                UITools.HideToolBarSeparator(uwToolbar, "DuplicateSep");
                UITools.HideToolBarButton(uwToolbar, "Duplicate");

                /* Alternate for CR 5096(Removal of rejection functionality)--start
                 * UITools.HideToolBarSeparator(uwToolbar, "RejectSep");
                 * UITools.HideToolBarButton(uwToolbar, "Reject"); */
                UITools.HideToolBarSeparator(uwToolbar, "ilbSep");
                UITools.HideToolBarButton(uwToolbar, "ilb");
                // Alternate for CR 5096(Removal of rejection functionality)--end
            }

            if (_Item != null)
            {
                InputFormChunkList chunks     = InputFormChunk.GetByInputForm(_Item.Id, _InputformId, SessionState.Culture.Code);
                InputFormChunkList chunksList = new InputFormChunkList();
                chunksList = UpdateCandidate(chunks);
                if (chunksList.Count > 0)
                {
                    dg.DataSource = chunksList;
                    Utils.InitGridSort(ref dg, false);
                    dg.DataBind();
                    dg.DisplayLayout.AllowSortingDefault = AllowSorting.No;
                    dg.DisplayLayout.Pager.AllowPaging   = false;
                    InitializeGridGrouping();

                    dg.Visible       = true;
                    lbResult.Visible = false;
                }
                else
                {
                    dg.Visible       = false;
                    lbResult.Visible = true;
                }
            }
        }