RadGrid for ASP.NET AJAX

RadControls for ASP.NET AJAX

To display the grid column editors inline when the grid switches into edit mode, change the table view's EditMode property to "InPlace".

CopyASPX
<telerik:RadGrid
   ID="RadGrid1" runat="server"
   DataSourceID="SqlDataSource1"
   GridLines="None">
   <MasterTableView
      EditMode="InPlace"
      DataSourceID="SqlDataSource1">
      <Columns>
         <telerik:GridEditCommandColumn />
      </Columns>
   </MasterTableView>
</telerik:RadGrid>

A row in edit mode

Note

To limit the number of characters the user can enter in the text box editor of the inline editor, set the MaxLength property of the column.

Relations between the edited item and the item in regular mode

When InPlace editing is applied, the grid row is of type GridDataItem in regular mode and GridEditableItem in edit regime. Hence you can cast the item in the ItemCreated event (for example) to those types according to its current mode:

For information about how to reference controls inside grid rows and edit forms, see Referencing controls in grid row/edit form.

Detecting edit/insert mode with in-place editing

To determine whether edit or insert operation is in progress inside the ItemCreated/ItemDataBound handler of the grid (when having inplace editing), check whether the e.Item instance inside the handler is of type GridEditableItem or GridDataInsertItem respectively. Here are some code snippets which illustrate the approach in question: