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

4 posts, 1 answers
  1. Ken
    Ken avatar
    5 posts
    Member since:
    Aug 2014

    Posted 08 Oct 2015 Link to this post

    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!

  2. Yoan
    Admin
    Yoan avatar
    1066 posts

    Posted 09 Oct 2015 Link to this post

    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
  3. UI for WPF is Visual Studio 2017 Ready
  4. Ken
    Ken avatar
    5 posts
    Member since:
    Aug 2014

    Posted 09 Oct 2015 in reply to Yoan Link to this post

    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?
  5. Answer
    Yoan
    Admin
    Yoan avatar
    1066 posts

    Posted 12 Oct 2015 Link to this post

    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
Back to Top