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 cell in row and visual style in WPF

Thread ID:

Created:

Updated:

Platform:

Replies:

120820 Oct 19,2015 07:08 AM Oct 20,2015 07:26 AM WPF 3
loading
Tags: SfDataGrid
Martin Tichovsky
Asked On October 19, 2015 07:08 AM

Hello,

i have two simple questions.

1. After new version of syncfusion components, i find out new function about merge cells. Unfortunately i can't find solution for merging cells in row. In my example, i would like to merge rows at last position of DataGrid and merge column C1 + C2 AND C3 + C4 + C5. Solution must have at last position 4 cells (2 merge cells).

2. I have question about styles in syncfusion. I using custom styles for sf:DateTimeEdit (in App.xaml) for choice month and year only. But with using custom style for other components, default visual style for TabControlExt doesn't work. In example you see tabs with Metro visual style, but custom styles this default Tab style replaced. Original Metro style have white font color in tabs, this custom styles changes default color to another, but linking another Metro style in App.xaml doesn't work. 

Thank you very mutch for help

Martin

Attachment: TestWPF_b03b14b.zip

Elangovan S [Syncfusion]
Replied On October 19, 2015 09:41 AM

Hi Martin,

Thank you for contacting Syncfusion Support.

Query 1:

We have analyzed your query, as per your requirement we have merged the columns C1 + C2 and C3 + C4 + C5 based on ColumnIndex by using QueryCoveredRange event trigger. Please find the following code example.


Grid.QueryCoveredRange += Grid_QueryCoveredRange;


void Grid_QueryCoveredRange(object sender, Syncfusion.UI.Xaml.Grid.GridQueryCoveredRangeEventArgs e)

        {

            if (e.RowColumnIndex.ColumnIndex == 2)

            {

                e.Range = new CoveredCellInfo(2, 3, e.RowColumnIndex.RowIndex, e.RowColumnIndex.RowIndex);

                e.Handled = true;

            }

            else if (e.RowColumnIndex.ColumnIndex == 4)

            {

                e.Range = new CoveredCellInfo(4, 6, e.RowColumnIndex.RowIndex, e.RowColumnIndex.RowIndex);

                e.Handled = true;

            }

        }


You can download the sample from the following location:

http://www.syncfusion.com/downloads/support/forum/120820/ze/TestWPF1259879898

Query 2:

A support incident to track the status of this query has been created under your account. Please log on to our support website to check for further updates

https://www.syncfusion.com/account/login?ReturnUrl=/support/directtrac/incidents

Regards,

Elangovan S


Martin Tichovsky
Replied On October 20, 2015 12:19 AM

Hello,

Your example is technically good, but i would like merge only last row in the table. For idea, i have data (numbers) in the table, and last row is sumary of C1 + C2 and C3 + C4 + C5. Thank you for help

Sivakumar R [Syncfusion]
Replied On October 20, 2015 07:26 AM

Hi Martin,

You can achieve your requirement by setting Range based on RowIndex in QueryCoveredRange event. Find the code snippet and sample details below,

Code snippet:

void Grid_QueryCoveredRange(object sender, Syncfusion.UI.Xaml.Grid.GridQueryCoveredRangeEventArgs e)

{

    if (Grid.GetLastDataRowIndex() == e.RowColumnIndex.RowIndex)

    {

        if (e.RowColumnIndex.ColumnIndex == 2)

        {

            e.Range = new CoveredCellInfo(2, 3, e.RowColumnIndex.RowIndex, e.RowColumnIndex.RowIndex);

            e.Handled = true;

        }

        else if (e.RowColumnIndex.ColumnIndex == 4)

        {

            e.Range = new CoveredCellInfo(4, 6, e.RowColumnIndex.RowIndex, e.RowColumnIndex.RowIndex);

            e.Handled = true;

        }

    }
}


Image:


Sample:
http://www.syncfusion.com/downloads/support/forum/120820/ze/TestWPF355607939

Thanks,
Sivakumar

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.

;