CellEditorPresenter Class
Represents an object that is used to configure and display cell editors within property grid cells.
Namespace: DevExpress.Xpf.PropertyGrid
Assembly: DevExpress.Xpf.PropertyGrid.v19.1.dll
Declaration
public class CellEditorPresenter :
Panel,
INavigationSupport
Public Class CellEditorPresenter
Inherits Panel
Implements INavigationSupport
Example
This example demonstrates a custom template that displays multiple properties in a single PropertyGridControl cell.
Both the absolute and relative paths are specified for the cell editor presenter objects.
using System;
namespace DXSample {
public class CategoryAttributesViewModel {
public virtual Person Person { get; protected set; }
public CategoryAttributesViewModel() {
Person = new Person {
FirstName = "Anita",
LastName = "Benson",
Address = new Address {
AddressLine1 = "9602 South Main",
AddressLine2 = "Seattle, 77025, USA",
},
Phone = "7138638137",
};
}
}
public class Person {
public string FirstName { get; set; }
public string LastName { get; set; }
public Address Address { get; set; }
public string Phone { get; set; }
}
public class Address {
public string AddressLine1 { get; set; }
public string AddressLine2 { get; set; }
}
}
using System;
using System.Windows;
namespace DXSample {
public partial class MainWindow : Window {
public MainWindow() {
InitializeComponent();
}
}
}
<Window x:Class="DXSample.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core"
xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors"
xmlns:dxprg="http://schemas.devexpress.com/winfx/2008/xaml/propertygrid"
xmlns:dxmvvm="http://schemas.devexpress.com/winfx/2008/xaml/mvvm"
xmlns:local="clr-namespace:DXSample"
DataContext="{dxmvvm:ViewModelSource Type=local:CategoryAttributesViewModel}"
dx:ThemeManager.ThemeName="Office2013"
Title="MainWindow" Height="350" Width="525">
<Grid>
<dxprg:PropertyGridControl SelectedObject="{Binding Person}" ExpandCategoriesWhenSelectedObjectChanged="True" ShowProperties="WithPropertyDefinitions">
<dxprg:PropertyGridControl.PropertyDefinitions>
<dxprg:PropertyDefinition Path="FirstName"/>
<dxprg:PropertyDefinition Path="LastName"/>
<dxprg:PropertyDefinition Path="Address" Header="Contact">
<dxprg:PropertyDefinition.ContentTemplate>
<DataTemplate>
<StackPanel>
<dxprg:CellEditorPresenter Path="AddressLine1"/>
<dxprg:CellEditorPresenter Path="AddressLine2"/>
<dxprg:CellEditorPresenter Path="Phone" PathMode="Absolute"/>
</StackPanel>
</DataTemplate>
</dxprg:PropertyDefinition.ContentTemplate>
</dxprg:PropertyDefinition>
</dxprg:PropertyGridControl.PropertyDefinitions>
</dxprg:PropertyGridControl>
</Grid>
</Window>
Imports System
Imports System.Collections.Generic
Imports System.Configuration
Imports System.Data
Imports System.Linq
Imports System.Threading.Tasks
Imports System.Windows
Namespace DXSample
''' <summary>
''' Interaction logic for App.xaml
''' </summary>
Partial Public Class App
Inherits Application
End Class
End Namespace
<Application x:Class="DXSample.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
StartupUri="MainWindow.xaml">
<Application.Resources>
</Application.Resources>
</Application>
Imports System
Imports System.Windows
Namespace DXSample
Partial Public Class MainWindow
Inherits Window
Public Sub New()
InitializeComponent()
End Sub
End Class
End Namespace
Imports System
Namespace DXSample
Public Class CategoryAttributesViewModel
Private privatePerson As Person
Public Overridable Property Person() As Person
Get
Return privatePerson
End Get
Protected Set(ByVal value As Person)
privatePerson = value
End Set
End Property
Public Sub New()
Person = New Person With {.FirstName = "Anita", .LastName = "Benson", .Address = New Address With {.AddressLine1 = "9602 South Main", .AddressLine2 = "Seattle, 77025, USA"}, .Phone = "7138638137"}
End Sub
End Class
Public Class Person
Public Property FirstName() As String
Public Property LastName() As String
Public Property Address() As Address
Public Property Phone() As String
End Class
Public Class Address
Public Property AddressLine1() As String
Public Property AddressLine2() As String
End Class
End Namespace
The following code snippets (auto-collected from DevExpress Examples) contain references to the CellEditorPresenter class.
Note
The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.
See Also