I have implemented a test using the related grid example. My difference is that I have an edit command column and a template for the edit form. All the grids are updated via AJAX. The grids interrelate correctly, but when clicking on the edit button or add record link the form doesn't display. If I turn off AJAX the form displays, but the application slows down significantly.
Thanks
Code behind:
Protected Sub grdFacilities_ItemCommand(ByVal source As Object, ByVal e As GridCommandEventArgs) Handles grdFacilities.ItemCommand |
If e.CommandName = "RowClick" Then |
Dim id As Integer = Int32.Parse(e.Item.OwnerTableView.DataKeyValues(e.Item.ItemIndex)("ID")) |
lblStatus.Text = "Selected Facility ID " & id |
Else |
lblStatus.Text = "e.CommandName = " & e.CommandName |
End If |
End Sub |
ASPX grid code:
<telerik:RadGrid ID="grdFacilities" runat="server" GridLines="None" DataSourceID="FacilitiesGridObjectDataSource" |
OnItemDeleted="grdFacilities_ItemDeleted" OnItemInserted="grdFacilities_ItemInserted" OnItemUpdated="grdFacilities_ItemUpdated" OnItemCommand="grdFacilities_ItemCommand" |
AllowMultiRowEdit="True" AllowAutomaticDeletes="True" AllowAutomaticInserts="True" AllowAutomaticUpdates="True" > |
<MasterTableView DataKeyNames="ID" AutoGenerateColumns="False" DataSourceID="FacilitiesGridObjectDataSource" EditMode="PopUp" |
CommandItemDisplay="Top" NoMasterRecordsText="No facilities on file" > |
<Columns> |
<telerik:GridEditCommandColumn ButtonType="ImageButton"> |
<ItemStyle CssClass="MyImageButton" /></telerik:GridEditCommandColumn> |
<telerik:GridBoundColumn DataField="ID" ReadOnly="True" HeaderText="ID" DataType="System.Int32" UniqueName="ID"> |
<ItemStyle ForeColor="Gray" /></telerik:GridBoundColumn> |
<telerik:GridBoundColumn DataField="FacilityName" ReadOnly="True" HeaderText="Facility" UniqueName="FacilityName" ></telerik:GridBoundColumn> |
<telerik:GridButtonColumn ConfirmText="Delete this Facility?" ConfirmDialogType="RadWindow" ConfirmTitle="Delete" ButtonType="ImageButton" |
CommandName="Delete" Text="Delete" UniqueName="DeleteColumn"> |
<ItemStyle HorizontalAlign="Center" CssClass="MyImageButton" /></telerik:GridButtonColumn> |
</Columns> |
<EditFormSettings EditFormType="Template" PopUpSettings-Width="587px"> |
<FormTemplate> |
<table id="Table7" cellspacing="1" cellpadding="1" width="350" border="0"><tr><td>Name</td> |
<td><asp:TextBox ID="txtFirstName" runat="server" Text='<%# Bind( "FacilityName" ) %>'></asp:TextBox></td></tr> |
</table> |
<asp:ImageButton ID="btnUpdate" runat="server" |
ImageUrl="images/saveBtnBg.gif" CommandName='<%# IIf( DataBinder.Eval(Container, "OwnerTableView.IsItemInserted"), "PerformInsert", "Update") %>'> |
</asp:ImageButton> |
<asp:ImageButton ID="btnCancel" runat="server" |
ImageUrl="images/cancelBtnBg.gif" CommandName="Cancel"></asp:ImageButton> |
</FormTemplate> |
<EditColumn UniqueName="EditCommandColumn1"> |
</EditColumn> |
<FormCaptionStyle BorderColor="White" BorderStyle="None" ForeColor="Black" /></EditFormSettings> |
<CommandItemSettings AddNewRecordText="Add Facility" /> |
</MasterTableView> |
<HeaderContextMenu EnableTheming="True" Skin="Vista"> |
<CollapseAnimation Duration="200" Type="OutQuint" /> |
</HeaderContextMenu> |
<ClientSettings enablepostbackonrowclick="true"> |
<Selecting AllowRowSelect="true" /> |
<Scrolling AllowScroll="True" ScrollHeight="40%" UseStaticHeaders="True" /> |
</ClientSettings> |
</telerik:RadGrid> |
Thanks