﻿<?xml version="1.0" encoding="utf-8"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:media="http://search.yahoo.com/mrss/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0"><channel><title>Intersoft Community - WebGrid Enterprise - Select Columns not working</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Select-Columns-not-working/</link><description /><generator>http://www.intersoftsolutions.com</generator><language>en</language><copyright>Copyright 2002 - 2015 Intersoft Solutions Corp. All rights reserved.</copyright><ttl>60</ttl><item><title>Select Columns not working</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Select-Columns-not-working/</link><pubDate>Thu, 15 Oct 2009 23:58:24 GMT</pubDate><dc:creator>handy@intersoftpt.com</dc:creator><description>&lt;p&gt;Glad to hear that it solved your issue.&lt;/p&gt;&lt;p&gt;Regards,&lt;br /&gt;Handy&lt;/p&gt;</description></item><item><title>Select Columns not working</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Select-Columns-not-working/</link><pubDate>Thu, 15 Oct 2009 19:14:18 GMT</pubDate><dc:creator>Mark.R.P</dc:creator><description>&lt;p&gt;Thanks, this has resolved my issue.&lt;/p&gt;</description></item><item><title>Select Columns not working</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Select-Columns-not-working/</link><pubDate>Thu, 15 Oct 2009 03:31:43 GMT</pubDate><dc:creator>handy@intersoftpt.com</dc:creator><description>&lt;p&gt;Hi Mark,&lt;/p&gt;&lt;p&gt;It is simple, you forgot to have a logic behind your code. The issue occured because when you removed a column, OnInitializeLayout would be called again and your layout would be re rendered again. To avoid this, you need to add &lt;b&gt;&lt;i&gt;'If(!ISPostBack)'&lt;/i&gt;&lt;/b&gt; on your code.&lt;/p&gt;
&lt;p&gt;e.g&lt;/p&gt;
&lt;p /&gt;&lt;pre&gt; protected void wgQuickPriceEntry_InitializeLayout(object sender, LayoutEventArgs e)
    {
        if (!IsPostBack)
        {
            e.Layout.AllowAddNew = AddNew.No;
            e.Layout.AllowColumnMove = ColumnMove.Yes;
            e.Layout.AllowColumnSizing = ColumnSizing.Yes;
            e.Layout.AllowColumnFreezing = ColumnFreezing.No;
            e.Layout.AllowContextMenu = true;
            e.Layout.AllowDelete = Delete.No;
            e.Layout.AllowEdit = Edit.Yes;
            e.Layout.AllowExport = Export.Yes;
            e.Layout.AllowFilter = Filter.Yes;
            e.Layout.AllowGrouping = Grouping.Yes;
            e.Layout.AllowSelectColumns = SelectColumns.Yes;
            e.Layout.AllowSorting = Sorting.Yes;
            e.Layout.ApplyFiltersKey = FilterKeyMode.Enter;
            e.Layout.AutoFilterSuggestion = true;
            e.Layout.ColumnFooters = ColumnVisibility.No;
            e.Layout.ColumnHeaders = ColumnVisibility.Yes;
            e.Layout.GroupByBoxVisible = true;
            e.Layout.HeaderClickAction = HeaderClick.SortMulti;
            e.Layout.InProgressUIBehavior = InProgressUIBehavior.ChangeCursorToHourGlass;
            e.Layout.PagingMode = PagingMode.VirtualLoad;
            e.Layout.PersistRowChecker = true;
            e.Layout.ShowFilterStatus = true;
            e.Layout.ShowRefreshButton = true;
            e.Layout.StatusBarVisible = true;
            e.Layout.VirtualLoadMode = VirtualLoadMode.Default;
            e.Layout.VirtualPageSize = 100;
            wgQuickPriceEntry.UseDefaultStyle = true;
            wgQuickPriceEntry.DefaultStyleMode = DefaultStyleKind.Elegant;
            e.Layout.FreezePaneSettings.ActiveFrozenColumns = 1;
            e.Layout.FreezePaneSettings.MaxFrozenColumns = 1;
            e.Layout.HideColumnsWhenGrouped = HideColumns.No;
            e.Layout.CellClickAction = CellClick.CellSelect;
            e.Layout.EditOnClick = true;
            // apply properties that cannot be modified
            e.Layout.AlwaysShowHelpButton = false;
            e.Layout.RowHeightDefault = new Unit("");
            for (int i = 1; i &amp;lt;= 50; i&amp;#43;&amp;#43;)
            {
                wgQuickPriceEntry.RootTable.Columns.GetNamedItem("PL" &amp;#43; i).Visible = (i &amp;lt;= 4);
            }
        }
    }&lt;/pre&gt;
&lt;p&gt;Hope this helps.&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Handy&lt;/p&gt;
&lt;p /&gt;</description></item><item><title>Select Columns not working</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Select-Columns-not-working/</link><pubDate>Wed, 14 Oct 2009 23:49:41 GMT</pubDate><dc:creator>Mark.R.P</dc:creator><description>&lt;p&gt;I have a grid that has 55 columns. Any of the last 50 can be either visible or invisible based on certain conditions. If I try an remove the last visble column using the column select option the column does not actually get removed.&lt;/p&gt;
&lt;p&gt;I have built a sample to illustrate this behaviour. Please use the select columns option to remove the PL4 column from the grid. You will find after hitting the apply button that the column is still visible in the grid.&lt;/p&gt;
&lt;p&gt;Can you please advise on how I can get this functionality to work?&lt;/p&gt;</description></item></channel></rss>