We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to Implement Show Column Choser On Dynamic Binding Grid.

Thread ID:

Created:

Updated:

Platform:

Replies:

124274 May 28,2016 08:15 AM UTC May 30,2016 09:13 AM UTC ASP.NET MVC 1
loading
Tags: Grid
Mithun Revankar
Asked On May 28, 2016 08:15 AM UTC

Hie,

I Am Trying To Implement Dynamic Columnchoser for dynamically binded Ejgrid, still I am Unable to do it. Please let me help To find the solution.

my code is as follows
------------------------------------------------------------------------------------------------------------------------------------------------------------------------


 @(Html.EJ().Grid<CRM.ViewModel.CustomerIndexVM>("FlatGrid1")
                                     .Datasource(ds => ds.URL("../Customer/DataSource?Type=" + @ViewBag.Type + "&IsActive=" + @ViewBag.IsActive + "").Adaptor("UrlAdaptor").Offline(true))
                                     .AllowSorting()
                                     .AllowPaging().PageSettings(p => { p.PageSize(19); })
                                     .ShowColumnChooser()
                                     .AllowFiltering()
                                     .FilterSettings(filter => { filter.FilterType(FilterType.Menu); })
                                     .AllowSearching()
                                     .AllowSelection()
                                     .AllowResizeToFit()

                                             .ToolbarSettings(toolBar => toolBar.ShowToolbar(true).ToolbarItems(items =>
                                                    {
                                                        items.AddTool(ToolBarItems.Add);
                                                        items.AddTool(ToolBarItems.ExcelExport);
                                                        items.AddTool(ToolBarItems.WordExport);
                                                        items.AddTool(ToolBarItems.PdfExport);
                                                        items.AddTool(ToolBarItems.PrintGrid);
                                                    }))
                                 
                                    .ClientSideEvents(eve => eve.ActionComplete("actionComplete"))
                                    .ClientSideEvents(eve => eve.DataBound("DataBound"))
                                    .ClientSideEvents(eve => { eve.ActionBegin("begin"); })
                                    .ClientSideEvents(evt => evt.ToolbarClick("OnToolbarClick")))

Balaji Marimuthu [Syncfusion]
Replied On May 30, 2016 09:13 AM UTC

Hi Mithun, 
 
Thanks for contacting Syncfusion support. 
 
We have considered “Column chooser does not render properly when bind the remote data with auto generated columns in Grid” as an issue and the fix will be included in our Vol 2, Service Pack 1 release.   
Until then, we suggest you to render the column chooser using client side events in Grid. Refer to the Sample, code example and help document as below. 
 
Sample: Sample-124274 
 
 
 
Note: Please remove the ShowColumnChooser property in Grid properties and use only client side events. 
 
 
@(Html.EJ().Grid<object>("FlatGrid") 
             .Datasource(ds => ds.URL("/Grid/DataSource").Adaptor(AdaptorType.UrlAdaptor).Offline(true)) 
         .AllowSorting() 
         .AllowPaging().PageSettings(p => { p.PageSize(19); }) 
             //.ShowColumnChooser() 
         .AllowFiltering() 
         .FilterSettings(filter => { filter.FilterType(FilterType.Menu); }) 
         .AllowSearching() 
         .AllowSelection() 
         .AllowResizeToFit() 
 
                 .ToolbarSettings(toolBar => toolBar.ShowToolbar(true).ToolbarItems(items => 
                                                    { 
                                                        items.AddTool(ToolBarItems.Add); 
                                                        items.AddTool(ToolBarItems.ExcelExport); 
                                                        items.AddTool(ToolBarItems.WordExport); 
                                                        items.AddTool(ToolBarItems.PdfExport); 
                                                        items.AddTool(ToolBarItems.PrintGrid); 
                                                    })) 
 
                                    .ClientSideEvents(eve => eve.ActionComplete("actionComplete")) 
                                    .ClientSideEvents(eve => eve.DataBound("DataBound")) 
                                    .ClientSideEvents(eve => { eve.ActionBegin("begin"); }) 
                                    .ClientSideEvents(evt => evt.ToolbarClick("OnToolbarClick"))) 
 
<script type="text/javascript"> 
 
    function DataBound(args) { 
        $("#FlatGrid").ejGrid({ 
            showColumnChooser: true 
        }); 
    } 
</script> 
 
 
 
 
Regards, 
Balaji Marimuthu 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;