This is a migrated thread and some comments may be shown as answers.

Show/Hide Columns issue

2 Answers 100 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Ulrich
Top achievements
Rank 1
Ulrich asked on 28 Apr 2010, 03:12 PM
Hello Telerik Team,

I have a radgrid which is programatically created, columns added during page init, exactly as shown in the demo.

Everything in this grid works perfectly but the show/hide columns-function in the headercontextmenu.

What could be a reason for this? When I click the checkbox in the menu, the menu simply closes again, and the display state of the column is not changed

best regards

Ulrik

2 Answers, 1 is accepted

Sort by
0
Ulrich
Top achievements
Rank 1
answered on 28 Apr 2010, 03:17 PM
I just wanted to add another (maybe important) piece of information:

When I take a look at the demo, the context menu stays open when you click on the show/hide checkbox

In my case, the context menu closes as soon as I click.

this is how I initialize the grid:

        
   this.AutoGenerateColumns = false
            this.Height = Unit.Pixel(650); 
            this.Width = Unit.Percentage(100); 
            this.AllowPaging = true
            this.PageSize = 25
            this.AllowSorting = true
            this.AllowCustomPaging = true
            this.MasterTableView.AllowMultiColumnSorting = true
            this.MasterTableView.GridLines = GridLines.Both; 
            this.MasterTableView.GroupLoadMode = GridGroupLoadMode.Server; 
            this.AllowMultiRowSelection = true
 
            this.PagerStyle.Mode = GridPagerMode.NextPrevNumericAndAdvanced; 
            this.ClientSettings.Scrolling.AllowScroll = true
            this.ClientSettings.Scrolling.EnableVirtualScrollPaging = true
            this.ClientSettings.Scrolling.UseStaticHeaders = true
            this.ClientSettings.Scrolling.SaveScrollPosition = true
 
            this.ClientSettings.AllowDragToGroup = true
            this.ClientSettings.AllowExpandCollapse = true
            this.ClientSettings.AllowGroupExpandCollapse = true
            this.ClientSettings.AllowColumnsReorder = true
            this.ClientSettings.AllowColumnHide = true
            this.ClientSettings.ColumnsReorderMethod = GridClientSettings.GridColumnsReorderMethod.Reorder; 
            this.ClientSettings.EnableAlternatingItems = true
            this.ClientSettings.EnableRowHoverStyle = true
            this.ClientSettings.Resizing.AllowColumnResize = true
            this.ClientSettings.Resizing.EnableRealTimeResize = true
            this.ClientSettings.Resizing.ResizeGridOnColumnResize = true
 
            this.RegisterWithScriptManager = true
            this.EnableHeaderContextMenu = true
            this.ShowStatusBar = true
            this.ShowHeader = true
            this.ShowFooter = true
            this.ShowGroupPanel = true
            this.EnableLinqExpressions = false
            this.GroupingSettings.CaseSensitive = false
            this.AllowFilteringByColumn = true
             
            this.ExportSettings.Csv.ColumnDelimiter = GridCsvDelimiter.Semicolon; 
            this.ExportSettings.Csv.FileExtension = ".csv"
            this.ExportSettings.Csv.RowDelimiter = GridCsvDelimiter.NewLine; 
 
            this.ExportSettings.Excel.FileExtension = ".xls"
            this.ExportSettings.Excel.Format = GridExcelExportFormat.ExcelML; 
 
 
            this.ExportSettings.Pdf.PageHeight = new Unit("297mm"); 
            this.ExportSettings.Pdf.PageWidth = new Unit("210mm"); 
            this.ExportSettings.Pdf.PaperSize = GridPaperSize.A4; 
           
 
            this.ExportSettings.IgnorePaging = true
            this.ExportSettings.ExportOnlyData = true
            this.ExportSettings.HideStructureColumns = true
            this.ExportSettings.OpenInNewWindow = true
            this.MasterTableView.CommandItemDisplay = GridCommandItemDisplay.Top; 
            this.MasterTableView.CommandItemSettings.ShowExportToCsvButton = true
            this.MasterTableView.CommandItemSettings.ShowExportToExcelButton = true
            this.MasterTableView.CommandItemSettings.ShowExportToPdfButton = true
            this.MasterTableView.CommandItemSettings.ShowExportToWordButton = true
            this.MasterTableView.CommandItemSettings.ShowRefreshButton = true
 

0
Pavlina
Telerik team
answered on 30 Apr 2010, 09:40 AM
Hello Ulrich,

I followed your scenario in order to replicate the issue you are facing but to no avail. Please, find attached a simple working application which handles the desired functionality. Give it a try and let me know if it works for you.

Sincerely yours,
Pavlina
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
Grid
Asked by
Ulrich
Top achievements
Rank 1
Answers by
Ulrich
Top achievements
Rank 1
Pavlina
Telerik team
Share this question
or