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. Image for the cookie policy date
close icon

How to merge specific Column on GridControl?

Hello Experts, I need advice with GridControl, I want to merge specific column in Grid, for example I've 3 columns 1)Location, 2)Row, 3) Column. Here I want to merge only Location column so that I can see the records only belonging to specific column. I did enabled the GridMergeCellsMode.MergeRowsInColumn BUT it also merges the Row (2nd Column) as well and I dont want that I just want to merge the first column (Ex. Location Only). How can I do that?
My Table Structure is
LocationRowColumn
Bay 1ABContainer 1
Bay 1ABContainer 2
Bay 1ABContainer 3

I just want to merge the First Column "Location" Please give suggetions on this.


3 Replies

MG Mohanraj Gunasekaran Syncfusion Team June 5, 2017 01:04 PM UTC

Hi Dhairya, 

Thanks for using the Syncfusion product. 

In order to merge the specific columns, you can use the QueryCanMergeCells event. Please refer to the below code example and the attached sample, 
 
Code example 
this.gridControl1.Model.QueryCanMergeCells += Model_QueryCanMergeCells; 
 
void Model_QueryCanMergeCells(object sender, GridQueryCanMergeCellsEventArgs e) 
{ 
    if (e.Style1.CellIdentity.ColIndex != 1) 
        e.Handled = true; 
} 

Sample link: GridControl 

Regards, 
Mohanraj G 



DJ Dhairya Joshi June 7, 2017 05:18 AM UTC

Thanks It Worked !


MG Mohanraj Gunasekaran Syncfusion Team June 8, 2017 04:25 AM UTC

Hi Dhairya, 

Thanks for your update. 

We are glad to know that your reported problem has been resolved. 

Please let me know, if you have any concerns. 

Regards, 
Mohanraj G 


Loader.
Live Chat Icon For mobile
Up arrow icon