ASPxClientGridView.StartEditRow(visibleIndex) Method
Switches the grid to edit mode.
Declaration
StartEditRow(
visibleIndex: number
): void
Parameters
Name | Type | Description |
---|---|---|
visibleIndex | number | The row’s visible index. |
Remarks
Call the StartEditRow
method to switch the grid to edit mode.
<dx:ASPxGridView ID="Grid" ClientInstanceName="ClientGrid" runat="server" ...>
<ClientSideEvents CustomButtonClick="onCustomButtonClick" />
<Columns>
<dx:GridViewCommandColumn>
<CustomButtons>
<dx:GridViewCommandColumnCustomButton ID="customEdit" Text="Edit" />
</CustomButtons>
</dx:GridViewCommandColumn>
<!-- ... -->
</Columns>
</dx:ASPxGridView>
var currentIndex = -1;
function onCustomButtonClick(s, e) {
if (e.buttonID == "customEdit") {
currentIdx = e.visibleIndex;
s.GetRowValues(currentIndex, "Discontinued", OnGetRowValues);
}
}
function OnGetRowValues(discontinuedVal) {
if (discontinuedVal) {
// ...
alert("Product is discontinued!");
}
else {
ClientGrid.StartEditRow(currentIndex);
}
}
See Also