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.
Unfortunately, activation email could not send to your email. Please try again.

Merge Grid Header

Thread ID:

Created:

Updated:

Platform:

Replies:

131717 Jul 25,2017 01:28 AM Jul 26,2017 12:55 PM ASP.NET MVC 1
loading
Tags: Grid
ritesh kumar
Asked On July 25, 2017 01:28 AM

Hi Team,
I want to Merge header and split row in multiple cell  in grid view, So please send me a demo code for merge Grid header in mvc   for you easy understand please find the attached image

Farveen Sulthana Thameeztheen Basha [Syncfusion]
Replied On July 26, 2017 12:55 PM

Hi Ritesh, 

Thanks for contacting Syncfusion Support. 

We have checked your query and we suspect that you need to Merge Grid Header  in MVC. We have achieved your requirement merge the Headers using “MergeHeaderCellInfo” event of the Grid. Please refer to the code example:- 

@(Html.EJ().Grid<object>("FlatGrid") 
        .Datasource((IEnumerable<object>)ViewBag.dataSource) 
            .AllowPaging() 
            .AllowSorting() 
            .ClientSideEvents(e => e.MergeHeaderCellInfo("mergeHeaderCellInfo")) 
           .Columns(col => 
          { 
             col.Field("OrderID").HeaderText("Order ID").IsPrimaryKey(true).ValidationRules(v => v.AddRule("required",true).AddRule("number", true)).Width(100).Add(); 
            col.Field("CustomerID").HeaderText("Customer ID").ValidationRules(v => v.AddRule("required", true).AddRule("minlength", 3)).Width(100).Add(); 
            .   .   . 
        }) 
         
    ) 
 
 <script> 
        function mergeHeaderCellInfo(args) { 
            args.headerCellMerge(1, 3); 
        } 
    </script> 


We have provided support for “MergeHeaderCellInfo” event from release version 15.2.0.43.  Please check the release notes :- 


Please refer to the API link :- 


We have prepared the sample Demo in v15.2.0.46 


Please get back to us if you need any further assistance. 

Regards, 

Farveen sulthana T 


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.

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.

;