ASPxClientCardView.GetEditor(column) Method
Returns the editor used to edit the specified column’s values.
Declaration
GetEditor(
column: ASPxClientCardViewColumn | number | string
): ASPxClientEdit
Parameters
Name | Type |
---|---|
column | string | number | ASPxClientCardViewColumn |
Returns
Type | Description |
---|---|
ASPxClientEdit | An ASPxClientEdit object that is the specified column’s editor. |
Remarks
The GetEditor method can be used to get access to an instance of the specified column’s inplace editor. This method is in effect when the grid is switched to edit mode. If the grid is in browse mode, the GetEditor method returns null.
Example
The following example iterates through column editors on the client and dynamically disables editors on an Edit Form when an editor’s value is changed. This approach cannot be used when edit templates are defined.
<dx:ASPxCardView ID="ASPxCardView1" ClientInstanceName="grid" OnCardUpdating="ASPxCardView1_CardUpdating" OnCellEditorInitialize="ASPxCardView1_CellEditorInitialize" runat="server" AutoGenerateColumns="False" DataSourceID="SqlDataSource1" KeyFieldName="ProductID">
<Columns>
<dx:CardViewTextColumn FieldName="ProductID" Visible="False" />
<dx:CardViewTextColumn FieldName="UnitPrice" />
<dx:CardViewTextColumn FieldName="UnitsInStock" />
<dx:CardViewTextColumn FieldName="UnitsOnOrder" />
<dx:CardViewCheckColumn FieldName="Discontinued" />
<PropertiesCheckEdit>
<ClientSideEvents CheckedChanged="function(s, e) {
for(i = 0; i < grid.GetColumnCount(); i++) {
var editor = grid.GetEditor(i);
if(editor != null && editor != s)
editor.SetEnabled(s.GetChecked());
} }" />
</PropertiesCheckEdit>
</dx:CardViewCheckColumn>
</Columns>
<CardLayoutProperties>
<Items>
<dx:CardViewCommandLayoutItem HorizontalAlign="Right" ShowEditButton="True" />
<dx:CardViewColumnLayoutItem ColumnName="UnitPrice" />
<dx:CardViewColumnLayoutItem ColumnName="UnitsInStock" />
<dx:CardViewColumnLayoutItem ColumnName="UnitsOnOrder" />
<dx:CardViewColumnLayoutItem ColumnName="Discontinued" />
<dx:EditModeCommandLayoutItem HorizontalAlign="Right" />
</Items>
</CardLayoutProperties>
</dx:ASPxCardView>
See Also