Error when publish web application in RadGrid

1 Answer 62 Views
Grid
M Kumar
Top achievements
Rank 1
Iron
Veteran
M Kumar asked on 27 Jul 2021, 06:45 AM

Hi
    I have web application, in that i add rad grid dynamically  (from server side code), when debug and run no error , but when i try to publish from VS2015 i am getting lots of error like "is not member of rad grid"
Screenshot - http://prntscr.com/1gi4k9o.

Code

 Dim grid As New RadGrid
        grid.ID = "ReportGrid"
        ' grid.RenderMode = RenderMode.Lightweight
        grid.AutoGenerateColumns = False
        grid.EnableViewState = False

        'grid.MasterTableView.CommandItemDisplay = GridCommandItemDisplay.Top
        'grid.MasterTableView.CommandItemSettings.ShowPrintButton = True
        'grid.MasterTableView.CommandItemSettings.ShowExportToPdfButton = True
        'grid.MasterTableView.CommandItemSettings.ShowExportToCsvButton = True
        'grid.MasterTableView.CommandItemSettings.ShowExportToExcelButton = True
        'grid.MasterTableView.CommandItemSettings.ShowExportToWordButton = True
        'grid.MasterTableView.CommandItemSettings.ShowRefreshButton = False
        'grid.MasterTableView.CommandItemSettings.ShowAddNewRecordButton = False
        'grid.EnableEmbeddedSkins = False
        'grid.RenderMode = RenderMode.Lightweight
        'grid.Skin =


        grid.AllowSorting = True
        grid.ClientSettings.Scrolling.AllowScroll = True
        grid.ClientSettings.Scrolling.UseStaticHeaders = True
        grid.ClientSettings.Scrolling.SaveScrollPosition = True


        'paging and virtualizaton

        grid.ClientSettings.Virtualization.EnableVirtualization = True
        grid.ClientSettings.Virtualization.InitiallyCachedItemsCount = 2000
        grid.ClientSettings.Virtualization.ItemsPerView = 100
        grid.PagerStyle.Mode = GridPagerMode.NextPrevNumericAndAdvanced

        grid.AllowPaging = True
        grid.PageSize = 1000

        grid.MasterTableView.TableLayout = GridTableLayout.Fixed
        grid.MasterTableView.PagerStyle.Visible = False

        'paging ...



        AddHandler grid.NeedDataSource, AddressOf ListReportGrid_NeedDataSource
        AddHandler grid.PreRender, AddressOf ListReportGrid_PreRender
        CreateListReportColumns(grid, reportId, cabinet)
        reportContentPanel.Controls.Add(grid)



Pls reply asap

 

Thanks

1 Answer, 1 is accepted

Sort by
0
Doncho
Telerik team
answered on 29 Jul 2021, 10:19 AM

Hi Kumar,

I have reused the provided code to create a basic sample and on my side it is working as expected. I have attached it to my response so you can give it a try.

It would be helpful if you share the steps for replicating the problem with the provided sample.

Additionaly I would like to share some information relevant to the current scenario:

  • Generating RadGrid programmatically can get quite tricky, so I suggest following the instructions in our Creating a RadGrid Programmatically
  • The ViewState of RadGrid is crucial for some of its features, see the end of Optimizing ViewState usage article to find a list of limitations. For flawless work with RadGrid, we recommend keeping the view state of the control enabled. If there is any concern with the performance I would suggest you review our Grid Performance Optimizations article, and find other means for improving the performance than disabling the view state.

Kind regards,
Doncho
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Tags
Grid
Asked by
M Kumar
Top achievements
Rank 1
Iron
Veteran
Answers by
Doncho
Telerik team
Share this question
or