I don't want the Frozen Columns Splitter to duplicate Column group header.

1 Answer 20 Views
GridView
Sven
Top achievements
Rank 1
Sven asked on 14 Jan 2022, 12:41 PM | edited on 14 Jan 2022, 12:48 PM

Hi,

on the Telerik website the following documentation can be found about Column Groups:

(figure 5 is not included here since it was not necessary)

I don't want the RadGridView to duplicate the column group once the FrozenColumnSplitter has been moved to the first column.
In my case I only have one column group, and I don't want it duplicated if the Frozen Column splitter is moved:

Do you know how I can change this?
Thanks!

1 Answer, 1 is accepted

Sort by
0
Stenly
Telerik team
answered on 18 Jan 2022, 02:04 PM

Hello Sven,

With the current implementation of the Column Groups feature of the RadGridView control, this behavior is not supported. However, with the presented information, that there would be only one Column Group, you could still achieve the wanted result by subscribing to the FrozenColumnsChanged event. Then, you could get all of the CommonColumnHeader elements from the RadGridView instance using the ChildrenOfType extension method. On the first element, set its BorderBrush property to Transparent, and on the second element, its Visibility property to Hidden. These elements could be retrieved using the ElementAtOrDefault method.

The following code snippet shows this logic's implementation:

private void telerikView_FrozenColumnsChanged_1(object sender, Telerik.Windows.Controls.GridView.GridView.FrozenColumnsChangedEventArgs e)
{
    var groupColumnHeaders = this.clubsGrid.ChildrenOfType<CommonColumnHeader>();
    var element1 = (CommonColumnHeader)groupColumnHeaders.ElementAtOrDefault(1);
    var element2 = groupColumnHeaders.ElementAtOrDefault(0).BorderBrush = Brushes.Transparent;

    if (element1 != null)
    {
        element1.Visibility = Visibility.Hidden;
    }
}

The produced result is as follows:

With that said, I hope the provided information is of help to you.

Regards,
Stenly
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Tags
GridView
Asked by
Sven
Top achievements
Rank 1
Answers by
Stenly
Telerik team
Share this question
or