ASR.Interface.DisplayElement.HasColumn C# (CSharp) Method

HasColumn() public method

Checks if a column name has also been added. You cannot repeat column names
public HasColumn ( string name ) : bool
name string
return bool
        public bool HasColumn(string name)
        {
            return columns.ContainsKey(name);
        }

Usage Example

        public override void Display(DisplayElement d_element)
        {
            Item itemElement = null;
            if (d_element.Element is Item)
            {
                itemElement = (Item)d_element.Element;
            }
            else if (d_element.Element is ID)
            {
                itemElement = Sitecore.Context.ContentDatabase.GetItem(d_element.Element as ID);
            }

            if (itemElement == null)
            {
                return;
            }
            d_element.Value = itemElement.Uri.ToString();

            d_element.Header = itemElement.Name;

            foreach (var column in Columns)
            {
                if (!d_element.HasColumn(column.Header))
                {
                    var text = getColumnText(column.Name, itemElement);
                    d_element.AddColumn(column.Header, string.IsNullOrEmpty(text) ? itemElement[column.Name] : text);
                }
            }
            d_element.Icon = itemElement.Appearance.Icon;
        }
All Usage Examples Of ASR.Interface.DisplayElement::HasColumn