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.

How to merge specific Column on GridControl?

Thread ID:

Created:

Updated:

Platform:

Replies:

130800 Jun 3,2017 11:30 AM Jun 8,2017 12:25 AM Windows Forms 3
loading
Tags: GridControl
Dhairya Joshi
Asked On June 3, 2017 11:30 AM

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.


Mohanraj Gunasekaran [Syncfusion]
Replied On June 5, 2017 09:04 AM

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 


Dhairya Joshi
Replied On June 7, 2017 01:18 AM

Thanks It Worked !

Mohanraj Gunasekaran [Syncfusion]
Replied On June 8, 2017 12:25 AM

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 


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.

;