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

Don't allow user to move column left of frozen column?

3 Answers 46 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Ken
Top achievements
Rank 1
Ken asked on 08 Oct 2015, 10:37 PM

Hi there,

I have a grid where I'm setting the first column frozen, hardcoding FrozenColumnCount="1" in the XAML.  I'm also allowing the user to reorder columns, but I don't want them to be able to move a column to the left of the frozen one, so I only ever have that 1 column frozen, is this possible?  Thanks!

3 Answers, 1 is accepted

Sort by
0
Yoan
Telerik team
answered on 09 Oct 2015, 06:34 AM
Hi Ken,

In order to achieve your goal, you can use GridView's ColumnReordering event and cancel it if the args.NewDisplayIndex is equal to 0.

Regards,
Yoan
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Ken
Top achievements
Rank 1
answered on 09 Oct 2015, 01:56 PM
Thanks for the reply!  Where do you think the best place would be to do this if I don't want to use code behind, an attached behavior?
0
Accepted
Yoan
Telerik team
answered on 12 Oct 2015, 07:31 AM
Hi,

If you want to have your code-behind clean, the way to go is with an Attached behavior. Here is a very nice article about event handling with attached behaviors. 

Regards,
Yoan
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
GridView
Asked by
Ken
Top achievements
Rank 1
Answers by
Yoan
Telerik team
Ken
Top achievements
Rank 1
Share this question
or