Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
95
Merge rows with multi conditions
posted

Hi Everybody,

I used the below code to merge rows which have same data on InitializeLayout event of WinGrid:

e.Layout.Override.MergedCellStyle = Infragistics.Win.UltraWinGrid.MergedCellStyle.Always;
e.Layout.Override.MergedCellContentArea = Infragistics.Win.UltraWinGrid.MergedCellContentArea.VirtualRect;
e.Layout.Override.HeaderClickAction = Infragistics.Win.UltraWinGrid.HeaderClickAction.SortMulti;

I describe my question in below picture:

In above picture, I want col2 column merges rows which have same data, but it belong to data of col1 column.

Anybody could help me.

Many thanks!

Parents
  • 469350
    Offline posted

    Hi,

    What you need to do is create a class which implements the IMergedCellEvaluator interface. Then you attach an instance of your IMergedCellEvaluator class to the MergedCellEvaluator property of Col2.

    When you implement the interface, you will only return true when both Col1 and Col2 are the same value.

Reply Children