Skip to main content
Tab

ASPxGridView.EditingRowVisibleIndex Property

Gets the index of the data row currently being edited.

Namespace: DevExpress.Web

Assembly: DevExpress.Web.v22.1.dll

Declaration

public int EditingRowVisibleIndex { get; }

Property Value

Type Description
Int32

An integer value that identifies the row currently being edited. -1 if no data row is being edited.

Remarks

Use the EditingRowVisibleIndex property to identify the data row currently being edited by an end-user. This can be useful when the focused row feature is disabled (the ASPxGridViewBehaviorSettings.AllowFocusedRow property is set to false). Otherwise, if the focused row is enabled, you can also use the ASPxGridView.FocusedRowIndex property.

Example

This example illustrates how to use the ASPxListBox control (ListEditSelectionMode) inside the EditForm for editing ASPxGridView.

View Example

    <h1>How to use ASPxListBox inside the EditForm for editing ASPxGridView</h1>
    <dx:ASPxGridView ID="ASPxGridView1" runat="server" AutoGenerateColumns="False" DataSourceID="AccessDataSource1"
        KeyFieldName="CategoryID" OnRowUpdating="ASPxGridView1_RowUpdating"  OnRowValidating="ASPxGridView1_RowValidating">
        <Columns>
            <dx:GridViewCommandColumn VisibleIndex="0" ShowEditButton="true">
            </dx:GridViewCommandColumn>
            <dx:GridViewDataTextColumn FieldName="CategoryID" ReadOnly="True" VisibleIndex="0">
                <EditFormSettings Visible="False" />
            </dx:GridViewDataTextColumn>
            <dx:GridViewDataTextColumn FieldName="CategoryName" VisibleIndex="1">
            </dx:GridViewDataTextColumn>
            <dx:GridViewDataTextColumn FieldName="Description" VisibleIndex="2">
            </dx:GridViewDataTextColumn>
        </Columns>
        <Templates>
            <EditForm>
                <dx:ASPxListBox ID="ASPxListBox1" runat="server" DataSourceID="AccessDataSource2"
                    SelectionMode="CheckColumn" TextField="ProductName" ValueField="ProductName" ValueType="System.String" OnDataBound="ASPxListBox1_DataBound">
                </dx:ASPxListBox>
                <br />
                <dx:ASPxGridViewTemplateReplacement ID="btnUpdate" runat="server" ReplacementType="EditFormUpdateButton"></dx:ASPxGridViewTemplateReplacement>
                <dx:ASPxGridViewTemplateReplacement ID="btnCancel" runat="server" ReplacementType="EditFormCancelButton"></dx:ASPxGridViewTemplateReplacement>
            </EditForm>
        </Templates>
    </dx:ASPxGridView>
</div>
<asp:AccessDataSource ID="AccessDataSource1" runat="server" DataFile="~/App_Data/nwind.mdb"
    SelectCommand="SELECT [CategoryID], [CategoryName], [Description] FROM [Categories]"
    DeleteCommand="DELETE FROM [Categories] WHERE [CategoryID] = ?"
    InsertCommand="INSERT INTO [Categories] ([CategoryID], [CategoryName], [Description]) VALUES (?, ?, ?)"
    UpdateCommand="UPDATE [Categories] SET [CategoryName] = ?, [Description] = ? WHERE [CategoryID] = ?">
    <DeleteParameters>
        <asp:Parameter Name="CategoryID" Type="Int32" />
    </DeleteParameters>
    <UpdateParameters>
        <asp:Parameter Name="CategoryName" Type="String" />
        <asp:Parameter Name="Description" Type="String" />
        <asp:Parameter Name="CategoryID" Type="Int32" />
    </UpdateParameters>
    <InsertParameters>
        <asp:Parameter Name="CategoryID" Type="Int32" />
        <asp:Parameter Name="CategoryName" Type="String" />
        <asp:Parameter Name="Description" Type="String" />
    </InsertParameters>
</asp:AccessDataSource>
<asp:AccessDataSource ID="AccessDataSource2" runat="server" DataFile="~/App_Data/nwind.mdb"
    SelectCommand="SELECT [ProductName] FROM [Products]"></asp:AccessDataSource>
See Also