ASPxGridView.FindEditFormTemplateControl(String) Method
Searches for the specified server control contained within the Edit Form‘s template.
Namespace: DevExpress.Web
Assembly:
DevExpress.Web.v21.2.dll
NuGet Package:
DevExpress.Web
Declaration
public Control FindEditFormTemplateControl(
string id
)
Public Function FindEditFormTemplateControl(
id As String
) As Control
Parameters
Name |
Type |
Description |
id |
String |
A String value that identifies the control within the Edit Form.
|
Returns
Type |
Description |
Control |
A Control object that represents the control contained within the Edit Form.
|
For more information, see Templates.
Example
For a full example, see Grid - Edit Form Templates demo.
protected string GetMemoText() {
ASPxPageControl pageControl = grid.FindEditFormTemplateControl("pageControl") as ASPxPageControl;
ASPxMemo memo = pageControl.FindControl("notesEditor") as ASPxMemo;
return memo.Text;
}
Protected Function GetMemoText() As String
Dim pageControl As ASPxPageControl = TryCast(grid.FindEditFormTemplateControl("pageControl"), ASPxPageControl)
Dim memo As ASPxMemo = TryCast(pageControl.FindControl("notesEditor"), ASPxMemo)
Return memo.Text
End Function
<dx:ASPxGridView ID="grid" runat="server" DataSourceID="DemoDataSource1" KeyFieldName="EmployeeID"
AutoGenerateColumns="False" OnRowUpdating="grid_RowUpdating" OnRowInserting="grid_RowInserting">
<Columns>
...
<dx:GridViewDataMemoColumn FieldName="Notes" Visible="False">
</dx:GridViewDataMemoColumn>
...
</Columns>
...
<Templates>
<EditForm>
<div style="padding: 4px 3px 4px">
<dx:ASPxPageControl runat="server" ID="pageControl" Width="100%">
<TabPages>
<dx:TabPage Text="Info" Visible="true">
<ContentCollection>
<dx:ContentControl runat="server">
<dx:ASPxGridViewTemplateReplacement ID="Editors" ReplacementType="EditFormEditors"
runat="server">
</dx:ASPxGridViewTemplateReplacement>
</dx:ContentControl>
</ContentCollection>
</dx:TabPage>
<dx:TabPage Text="Notes" Visible="true">
<ContentCollection>
<dx:ContentControl runat="server">
<dx:ASPxMemo runat="server" ID="notesEditor" Text='<%# Eval("Notes")%>' Width="100%" Height="93px" />
</dx:ContentControl>
</ContentCollection>
</dx:TabPage>
</TabPages>
</dx:ASPxPageControl>
</div>
<div style="text-align: right; padding: 2px">
<dx:ASPxGridViewTemplateReplacement ID="UpdateButton" ReplacementType="EditFormUpdateButton"
runat="server">
</dx:ASPxGridViewTemplateReplacement>
<dx:ASPxGridViewTemplateReplacement ID="CancelButton" ReplacementType="EditFormCancelButton"
runat="server">
</dx:ASPxGridViewTemplateReplacement>
</div>
</EditForm>
</Templates>
</dx:ASPxGridView>
See Also