Customize Modal dialog shown in PropertyGrid editor

2 posts, 1 answers
  1. Dharmavaram
    Dharmavaram avatar
    70 posts
    Member since:
    Jun 2013

    Posted 20 Sep Link to this post


       I have to customize the modal dialog shown when propertygrid editor attribute editor style value is 'Modal'. I don't want to show user Minimize and Maximize buttons of the window,I don't want to allow user to resize the dialog.I want to show form name  and Icon for the form of my own.

    How to achieve this??



  2. Answer
    Dilyan Traykov
    Dilyan Traykov avatar
    337 posts

    Posted 20 Sep Link to this post

    Hello Dharmavaram,

    I'm afraid the ModalEditor itself cannot be modified, but you could handle the BeginningEdit event (provided EditMode is set to Single) and create your custom editor there, similarly to:

    private void radPropertyGrid_BeginningEdit(object sender, Telerik.Windows.Controls.Data.PropertyGrid.PropertyGridBeginningEditEventArgs e)
        var pd = e.Field.DataContext as PropertyDefinition;
        var property = pd.SourceProperty;
        if (property.PropertyType == typeof(PhoneNumber))
            e.Cancel = true;
            var window = new RadWindow();
            window.DataContext = pd.Value;
            window.HideMaximizeButton = true;
            window.HideMinimizeButton = true;
            window.Header = "Phone Number";
            window.WindowStartupLocation = WindowStartupLocation.CenterOwner;
            window.Content = new PhoneEditorControl();

    Please let me know whether such an approach would be applicable for your scenario.

    Dilyan Traykov
    Telerik by Progress
    Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
  3. DevCraft banner
Back to Top