TreeListView.EditFormCaptionBinding Property
Gets or sets the binding that allows you to define the edit form caption.
Namespace: DevExpress.Xpf.Grid
Assembly:
DevExpress.Xpf.Grid.v24.2.dll
NuGet Package:
DevExpress.Wpf.Grid.Core
Declaration
public BindingBase EditFormCaptionBinding { get; set; }
Public Property EditFormCaptionBinding As BindingBase
Property Value
When the grid’s edit form is in dialog mode, it can display a caption. Use the EditFormCaptionBinding property to configure the edit dialog caption. The DataContext for this binding is the RowData object that represents the row that is being edited.
The following example demonstrates the grid control that displays a hierarchical list. The edit dialog caption contains the name of the selected employee.
<Window.DataContext>
<local:ViewModel/>
</Window.DataContext>
...
<dxg:GridControl Name="gC" ItemsSource="{Binding Employees}">
<dxg:GridControl.View>
<dxg:TreeListView KeyFieldName="ID" ParentFieldName="ParentID" EditFormShowMode="Dialog">
<dxg:TreeListView.EditFormCaptionBinding>
<Binding Path="Row.Name" RelativeSource="{RelativeSource Self}"/>
</dxg:TreeListView.EditFormCaptionBinding>
</dxg:TreeListView>
</dxg:GridControl.View>
</dxg:GridControl>
...
class ViewModel {
public ViewModel() {
Employees = Employee.GetEmployees();
}
public List<Employee> Employees { get; set; }
}
public class Employee {
public int ID { get; set; }
public int ParentID { get; set; }
public string Name { get; set; }
public string Position { get; set; }
public string Department { get; set; }
public static List<Employee> GetEmployees() {
List<Employee> employees = new List<Employee>();
employees.Add(new Employee() { ID = 1, ParentID = 0, Name = "Gregory S. Price", Department = "", Position = "President" });
employees.Add(new Employee() { ID = 2, ParentID = 1, Name = "Irma R. Marshall", Department = "Marketing", Position = "Vice President" });
employees.Add(new Employee() { ID = 3, ParentID = 1, Name = "John C. Powell", Department = "Operations", Position = "Vice President" });
employees.Add(new Employee() { ID = 4, ParentID = 1, Name = "Christian P. Laclair", Department = "Production", Position = "Vice President" });
employees.Add(new Employee() { ID = 6, ParentID = 2, Name = "Brian C. Cowling", Department = "Marketing", Position = "Manager" });
employees.Add(new Employee() { ID = 7, ParentID = 2, Name = "Thomas C. Dawson", Department = "Marketing", Position = "Manager" });
employees.Add(new Employee() { ID = 10, ParentID = 3, Name = "Harold S. Brandes", Department = "Operations", Position = "Manager" });
employees.Add(new Employee() { ID = 11, ParentID = 3, Name = "Michael S. Blevins", Department = "Operations", Position = "Manager" });
employees.Add(new Employee() { ID = 12, ParentID = 3, Name = "Jan K. Sisk", Department = "Operations", Position = "Manager" });
employees.Add(new Employee() { ID = 13, ParentID = 3, Name = "Sidney L. Holder", Department = "Operations", Position = "Manager" });
return employees;
}
}
See Also