iSeller Commerce
iSeller POS Retail
iSeller POS F&B
iSeller POS Express
Crosslight
WebUI
ClientUI
What's New
Download Trial
Web Solution
Mobile Solution
Enterprise Solution
Custom Development
Blog
Community
Latest Development Blogs
ForumPostTopic
Browse By Tag
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.
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.
Can you please advise on how I can get this functionality to work?
Hi Mark,
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 'If(!ISPostBack)' on your code.
e.g
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 <= 50; i++) { wgQuickPriceEntry.RootTable.Columns.GetNamedItem("PL" + i).Visible = (i <= 4); } } }
Hope this helps.
Regards,Handy
Thanks, this has resolved my issue.
Glad to hear that it solved your issue.
or
Choose this if you're already a member of Intersoft Community Forum. You can link your OpenID account to your existing Intersoft Social ID.
Choose this if you don't have an Intersoft account yet. Your authenticated OpenID will be automatically linked to your new Intersoft account.
Enter your Wordpress Blogname