This is a migrated thread and some comments may be shown as answers.

Radgridview able to resize after reordering columns

2 Answers 61 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Naved
Top achievements
Rank 1
Naved asked on 20 Mar 2017, 11:38 AM

Hi,

I have a custom control which inherits from Radgridview. For few columns (GridViewDataColumn), I have set IsResizable to false. However, when i reorder this column I am still able to resize it. Any ideas what might be the issue? 

When i set IsResizable to false what does it exactly do?

2 Answers, 1 is accepted

Sort by
0
Accepted
Dilyan Traykov
Telerik team
answered on 22 Mar 2017, 11:06 AM
Hello Naved,

This does seem like an issue at our end and I have thus logged a new bug report in our feedback portal. You can vote for the issue as well as subscribe to it in order to get notified about any changes in its status.

As a thank you for your help, I'm awarding you with some Telerik points.

A workaround you can use for the moment is to handle RadGridView's ColumnReordered event like so:

private void RadGridView_ColumnReordered(object sender, GridViewColumnEventArgs e)
{
    if (!e.Column.IsResizable)
    {
        Dispatcher.BeginInvoke((Action) (() =>
        {
            var radGridView = e.Column.Parent;
            foreach (var header in radGridView.ChildrenOfType<GridViewHeaderCell>())
            {
                if (header.Column.DisplayIndex == (e.Column.DisplayIndex + 1))
                {
                    var leftGripper = header.ChildrenOfType<Thumb>().Where(x => x.Name == "PART_LeftHeaderGripper").First();
                    {
                        leftGripper.Visibility = Visibility.Collapsed;
                    }
                }
            }
        }), DispatcherPriority.Render);
    }
}

I hope you find this applicable.

Regards,
Dilyan Traykov
Telerik by Progress
Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which you to write beautiful native mobile apps using a single shared C# codebase.
0
Naved
Top achievements
Rank 1
answered on 22 Mar 2017, 11:18 AM

Hi Dilyan,

The workaround is working fine for me.

Thanks mate.

Tags
GridView
Asked by
Naved
Top achievements
Rank 1
Answers by
Dilyan Traykov
Telerik team
Naved
Top achievements
Rank 1
Share this question
or