Exemple #1
0
    public static void InsertAttributeColumnsByTemplateColumn(PXGridColumnCollection columns, PXFieldCollection fields)
    {
        var attributeFields = fields.Where(f => f.StartsWith(Template) && char.IsDigit(f.Last())).ToList();

        int          templateFieldIndex = -1;
        PXGridColumn templateColumn     = null;

        foreach (PXGridColumn column in columns)
        {
            if (column.DataField == TemplateField)
            {
                templateFieldIndex = columns.IndexOf(column);
                templateColumn     = column;
            }

            attributeFields.Remove(column.DataField);
        }

        if (templateColumn != null)
        {
            foreach (string attributeField in attributeFields)
            {
                var newColumn = new PXGridColumn();
                newColumn.CopyFrom(templateColumn);
                newColumn.DataField = attributeField;
                columns.Insert(++templateFieldIndex, newColumn);
            }
        }
    }
Exemple #2
0
    public static void EnableCommitChangesAndMoveExtraColumnAtTheEnd(PXGridColumnCollection columns, int?extraColumnWidth = null, string linkCommand = null)
    {
        PXGridColumn extra = null;

        foreach (PXGridColumn col in columns)
        {
            col.CommitChanges = true;
            if (col.DataField == "Extra")
            {
                extra = col;
            }

            if (col.DataField.StartsWith(InventoryMatrixEntry.Template) && char.IsDigit(col.DataField.Last()))
            {
                col.LinkCommand = linkCommand;
            }
        }
        if (extra != null)
        {
            columns.Remove(extra);
            if (extraColumnWidth != null)
            {
                extra.Width = new Unit((int)extraColumnWidth);
            }
            extra.AllowDragDrop = false;
            extra.AllowMove     = false;
            extra.AllowResize   = false;
            columns.Add(extra);
        }
    }
Exemple #3
0
 public static void CreateItemsPage_ColumnsGenerated(PXGridColumnCollection columns)
 {
     foreach (PXGridColumn col in columns)
     {
         if (col.DataField == "Preliminary")
         {
             col.Style.CssClass = "CssEscalated";
             break;
         }
     }
 }