Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

TableView.EditFormDialogServiceTemplate Property

Specifies a data template that contains a service to display an Edit Form dialog window. This is a dependency property.

Namespace: DevExpress.Xpf.Grid

Assembly: DevExpress.Xpf.Grid.v24.2.dll

NuGet Package: DevExpress.Wpf.Grid.Core

#Declaration

public DataTemplate EditFormDialogServiceTemplate { get; set; }

#Property Value

Type Description
DataTemplate

A DataTemplate object.

#Remarks

The EditFormDialogServiceTemplate must contain a ServiceBase class descendant that implements the IDialogService interface. The default template contains the DialogService object.

The EditFormDialogServiceTemplate property is in effect only when you set the TableView.EditFormShowMode property to Dialog.

The following code sample uses the EditFormDialogServiceTemplate to customize the Edit Form dialog window and make it resizable:

<dxg:GridControl.View>
    <dxg:TableView EditFormShowMode="Dialog">
        <dxg:TableView.EditFormDialogServiceTemplate>
            <DataTemplate>
                <ContentControl>
                    <dx:DialogService>
                        <dx:DialogService.ViewTemplate>
                            <DataTemplate>
                                <dxg:PopupEditFormContainer 
                                    Content="{Binding}"
                                    dxg:DataControlBase.ActiveView="{Binding Source.View}"
                                    ContentTemplate="{Binding Path=Source.View.EditFormTemplate}"
                                    KeyboardNavigation.IsTabStop="False"/>
                            </DataTemplate>
                        </dx:DialogService.ViewTemplate>
                        <dx:DialogService.DialogStyle>
                            <Style TargetType="{x:Type dx:ThemedWindow}">
                                <Setter Property="ShowInTaskbar" Value="False"/>
                                <Setter Property="WindowStyle" Value="ToolWindow"/>
                                <Setter Property="ShowIcon" Value="False"/>
                                <Setter Property="UseLayoutRounding" Value="True"/>
                                <Setter Property="Width" Value="900"/>
                                <Setter Property="ResizeMode" Value="CanResizeWithGrip"/>
                                <Setter Property="SizeToContent" Value="Height"/>
                                <!-- Hides the default Update and Cancel buttons: -->
                                <Setter Property="dxci:ThemedWindowOptions.UseCustomDialogFooter" Value="True"/>
                            </Style>
                        </dx:DialogService.DialogStyle>
                    </dx:DialogService>
                </ContentControl>
            </DataTemplate>
        </dxg:TableView.EditFormDialogServiceTemplate>
    </dxg:TableView>
</dxg:GridControl.View>

Refer to the following help topics for more information: DialogService and Edit Form.

See Also