How can I initiate (raise) BeginningEdit event without of using of RadPropertyGrid.BeginEdit method?

2 posts, 1 answers
  1. Eugene
    Eugene avatar
    83 posts
    Member since:
    Jan 2016

    Posted 29 Apr Link to this post

    I write WPF MVVM Prism 6 application and try to use RadPropertyGrid. How can I initiate (raise) BeginningEdit event without of using of RadPropertyGrid.BeginEdit method? I cant call BeginEdit method because my application is pure MVVM one and I don't use codebehind. If I simply change the value of the property by typing the value of selected property then BeginningEdit event is not raised. Is there a way to initiate BeginningEdit event in MVVM application without call of BeginEdit method?
  2. Answer
    Maya
    Admin
    Maya avatar
    4062 posts

    Posted 02 May Link to this post

    Hello Eugene,

    Generally, events are intended to be used as an indication that the user has performed a certain action. So, calling them inside your code is not a recommended way to go. Why not performing the logic inside the code that updates the value? 
    Nevertheless, BeginningEdit event can be called as any other: 
    var editArgs = new PropertyGridBeginningEditEventArgs()
                {
                    RoutedEvent = RadPropertyGrid.BeginningEditEvent
                };
     
                this.propertyGrid.RaiseEvent(editArgs);

    But still, please keep in mind that events are supposed to be raised by the UI, not by some logic inside the end user code. 

    Regards,
    Maya
    Telerik
    Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
  3. UI for WPF is Visual Studio 2017 Ready
Back to Top