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

Customize Modal dialog shown in PropertyGrid editor

1 Answer 191 Views
PropertyGrid
This is a migrated thread and some comments may be shown as answers.
Dharmavaram
Top achievements
Rank 1
Dharmavaram asked on 20 Sep 2016, 11:43 AM

Hi, 

   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??

Regards,

Nagasree.

1 Answer, 1 is accepted

Sort by
0
Accepted
Dilyan Traykov
Telerik team
answered on 20 Sep 2016, 01:34 PM
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();
 
        window.Show();
    }
}

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

Regards,
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.
Tags
PropertyGrid
Asked by
Dharmavaram
Top achievements
Rank 1
Answers by
Dilyan Traykov
Telerik team
Share this question
or