set CommandButtonsVisibility via code behind

4 posts, 1 answers
  1. Kurt Landuyt
    Kurt Landuyt avatar
    9 posts
    Member since:
    Sep 2010

    Posted 22 Feb 2018 Link to this post

    Hi,

    Can't seem to find the way to set CommandButtonsVisibility from code behind. I'm building a user control with dynamic behavior the DataForm.
    In XAML it's easy and working.

    Anybody that has an idea?

    Thanks in advance!

    Kurt

  2. Randy Hompesch
    Randy Hompesch avatar
    120 posts
    Member since:
    Nov 2008

    Posted 23 Feb 2018 Link to this post

    If it'll help I did the job using xaml:

    CommandButtonsVisibility="{Binding Path=MyCommandButtonVisibility, Source={x:Static Application.Current}}"

    In this case the MyCommandButtonVisibility property was defined in app.xaml.cs.

    You should be able to modify this to taste.

     

  3. Answer
    Martin Ivanov
    Admin
    Martin Ivanov avatar
    2192 posts

    Posted 27 Feb 2018 Link to this post

    Hi Kurt,

    Here is an example how to set the CommandButtonsVisibility in code behind:
    this.dataForm.CommandButtonsVisibility =
                    Telerik.Windows.Controls.Data.DataForm.DataFormCommandButtonsVisibility.Commit |
                    Telerik.Windows.Controls.Data.DataForm.DataFormCommandButtonsVisibility.Cancel;
    This will show the OK and Cancel buttons.

    Regards,
    Martin Ivanov
    Progress Telerik
    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 allow you to write beautiful native mobile apps using a single shared C# codebase.
  4. Kurt Landuyt
    Kurt Landuyt avatar
    9 posts
    Member since:
    Sep 2010

    Posted 27 Feb 2018 Link to this post

    Works like a charm!! Thanks!
Back to Top