예제 #1
0
 public void UpdateGroupingFields()
 {
     if (this.Description == null || string.IsNullOrEmpty(this.Description.Expression))
     {
         this.groupFields = new GroupFieldElement[0];
     }
     else
     {
         this.panel.DisposeChildren();
         SortDescriptorCollection groupNames = this.Description.GroupNames;
         int count = groupNames.Count;
         List <GroupFieldElement> groupFieldElementList = new List <GroupFieldElement>();
         GridViewColumnCollection columns = this.TemplateElement.ViewTemplate.Columns;
         for (int index = 0; index < count; ++index)
         {
             GroupFieldElement groupFieldElement = new GroupFieldElement(this.TemplateElement, this.Description, groupNames[index]);
             if (groupFieldElement.Column != null)
             {
                 this.panel.Children.Add((RadElement)groupFieldElement);
                 groupFieldElementList.Add(groupFieldElement);
                 if (index < count - 1)
                 {
                     this.panel.Children.Add((RadElement) new GroupLinkElement(this.TemplateElement)
                     {
                         Type = GroupLinkElement.LinkType.NamesLink
                     });
                 }
             }
         }
         this.groupFields = groupFieldElementList.ToArray();
     }
 }
예제 #2
0
 public static bool IsUniqueName(GridViewColumnCollection collection, string name)
 {
     for (int index = 0; index < collection.Count; ++index)
     {
         if (collection[index].Name.Equals(name, StringComparison.InvariantCultureIgnoreCase))
         {
             return(false);
         }
     }
     return(true);
 }
예제 #3
0
 protected override object GetFieldValue(GridViewRowInfo item, string fieldName)
 {
     if (this.columns == null)
     {
         this.columns = this.listSource.Template.Columns;
     }
     GridViewDataColumn[] columnByFieldName = this.columns.GetColumnByFieldName(fieldName);
     if (columnByFieldName.Length > 0)
     {
         return(columnByFieldName[0].GetValue(item, GridViewDataOperation.Filtering));
     }
     return(this.columns[fieldName]?.GetValue(item, GridViewDataOperation.Filtering));
 }
예제 #4
0
        public static string GetUniqueName(GridViewColumnCollection collection, string baseName)
        {
            if (string.IsNullOrEmpty(baseName))
            {
                return(string.Empty);
            }
            if (collection[baseName] == null && char.IsNumber(baseName[baseName.Length - 1]))
            {
                return(baseName);
            }
            int num = 1;

            while (collection.Contains(string.Format("{0}{1}", (object)baseName, (object)num)))
            {
                ++num;
            }
            return(baseName + (object)num);
        }
예제 #5
0
        protected override bool VersionUpdateNeeded(NotifyCollectionChangedEventArgs args)
        {
            bool flag = base.VersionUpdateNeeded(args);

            if (!flag && !string.IsNullOrEmpty(args.PropertyName))
            {
                if (this.columns == null)
                {
                    this.columns = this.listSource.Template.Columns;
                }
                GridViewDataColumn[] columnByFieldName = this.columns.GetColumnByFieldName(args.PropertyName);
                for (int index = 0; index < columnByFieldName.Length; ++index)
                {
                    if (this.GroupDescriptors.Contains(columnByFieldName[index].Name) || this.SortDescriptors.Contains(columnByFieldName[index].Name))
                    {
                        return(true);
                    }
                }
            }
            return(flag);
        }