Different Edit Forms on Edit and Insert
In some editing scenarios you may need to display different edit forms for Telerik RadGrid on edit and insert action. This is easily achievable having WebUserControl custom edit form for your grid instance. You can hook the ItemCommand event of the grid and switch the user control when e.CommandName is RadGrid.EditCommand or RadGrid.InitInsertCommandName. Note that you also have to clear the rest of the edited items (on insert action) or hide the insertion form (on edit action) to avoid duplication of the edit form type for several edited grid items.The code below represents sample case:
<telerik:RadGrid RenderMode="Lightweight" ID="RadGrid1" runat="server" DataSourceID="SqlDataSource1" AutoGenerateColumns="False"
Width="100%" AllowSorting="True" AllowPaging="True">
<MasterTableView CommandItemDisplay="Top">
<EditFormSettings UserControlName="EmployeeDetailsVB.ascx" EditFormType="WebUserControl">
<EditColumn UniqueName="EditCommandColumn1">
</EditColumn>
</EditFormSettings>
<Columns>
<telerik:GridEditCommandColumn UniqueName="EditCommandColumn">
</telerik:GridEditCommandColumn>
<telerik:GridBoundColumn HeaderText="TOC" DataField="TitleOfCourtesy" UniqueName="TitleOfCourtesy">
<HeaderStyle Width="60px"></HeaderStyle>
</telerik:GridBoundColumn>
<telerik:GridBoundColumn HeaderText="FirstName" DataField="FirstName" UniqueName="FirstName">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn HeaderText="LastName" DataField="LastName" UniqueName="LastName">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn HeaderText="Hire Date" DataField="HireDate" UniqueName="HireDate">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn HeaderText="Title" DataField="Title" UniqueName="Title">
</telerik:GridBoundColumn>
</Columns>
</MasterTableView>
</telerik:RadGrid>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:NorthwindConnectionString %>"
SelectCommand="SELECT * FROM [Orders]"></asp:SqlDataSource>
With auto-generated edit forms or FormTemplate custom edit form you can merely show/hide some of the column editors (subscribing to the ItemCreated event of the grid). Additional info about this can be found here.