This is a migrated thread and some comments may be shown as answers.

Related grids caused lost FormTemplate access with AJAX

2 Answers 27 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Ken
Top achievements
Rank 1
Ken asked on 19 Dec 2008, 03:30 PM
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.

 

Code behind:

 

Protected Sub grdFacilities_ItemCommand(ByVal source As ObjectByVal 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

2 Answers, 1 is accepted

Sort by
0
Georgi Krustev
Telerik team
answered on 22 Dec 2008, 04:29 PM
Hello Ken,

Unfortunately we could not reproduce the issue which you described. In my test all grids are ajaxified and the edit form popped up every time. I used all the settings from your code example. Also please verify that RadAjaxManager has correctly defined ajax settings.

If the problem persists, I suggest you examine the attached test project and modify it in order to reproduce the problem. Thus I will do my best to assist you further in resolving it.

Best regards,
Georgi Krustev
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Ken
Top achievements
Rank 1
answered on 30 Dec 2008, 11:20 PM
In case anyone else runs into the problem.  My error was not having a reference to the top grid in the AJAX for that same grid.  Once added everything worked correctly.  All the examples just had edit links in the second grid, my problem was in the top grid only.  Thanks to Telerik support for their assistance.
Tags
Grid
Asked by
Ken
Top achievements
Rank 1
Answers by
Georgi Krustev
Telerik team
Ken
Top achievements
Rank 1
Share this question
or