ListView Remove Column


Node Information
Removes column from the specified ListView.
General Information
• This node doesn't have other available options.
Visual
Visual

Ports
Text Type DataType Accepts IsList CustomAcception
Add IN RUN MULTIPLE FALSE FALSE
ListView IN ListView ONE FALSE FALSE
Text IN String ONE FALSE FALSE

Source
namespace Korduene.KGraph.Nodes.UI.ListView
{
    [IsNode("Remove Column")]
    public class ListViewRemoveColumn : Node
    {
        Port run = new Port(PortType.IN, typeof(RUN), AcceptsLinks.MULTIPLE, "Add");
        Port text = new Port(PortType.IN, typeof(string), AcceptsLinks.ONE, "Text");
        Port control = new Port(PortType.IN, typeof(Korduene.Designer.Standard.ListView), AcceptsLinks.ONE, "ListView");
        public string Text
        {
            set { text.Value = value.ToString(); }
            get { return GetRuntimeValue(text); }
        }
        public ListViewRemoveColumn()
        {
            this.Name = "ListView Remove Column";
            this.NodeType = KGraph.NodeType.Method;
            AddPort(run);
            AddPort(control);
            AddPort(text);
            Information = "Removes column from the specified ListView.";
        }
        public override string Code()
        {
            return "foreach(ColumnHeader item in " + GetValue(control) + ".Columns){if(item.Text == " + GetValue(text) + "){" + GetValue(control) + ".Columns.Remove(item); break;}}";
        }
    }
}