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

JavaScript error going into Inline Edit mode

1 Answer 57 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Andrew
Top achievements
Rank 2
Andrew asked on 02 Feb 2010, 04:28 AM
hello,  I'm having trouble setting up a grid on a page to use inline editing.  I have followed the examples given, but When i clicck on the edit button, the browser hangs, and I get an error saying that I need to register the script with the ClientScriptManager.  Here is the code:

<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">  
 
        <script type="text/javascript">  
            function RowDblClick(sender, eventArgs) {  
                sender.get_masterTableView().editItem(eventArgs.get_itemIndexHierarchical());  
            }  
        </script> 
 
    </telerik:RadCodeBlock> 
 
...a small div that is not affected  
 
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">  
        <AjaxSettings> 
            <telerik:AjaxSetting AjaxControlID="rgFollowups">  
                <UpdatedControls> 
                    <telerik:AjaxUpdatedControl ControlID="rgFollowups" LoadingPanelID="RadAjaxLoadingPanel1" /> 
                    <telerik:AjaxUpdatedControl ControlID="RadWindowManager1" /> 
                </UpdatedControls> 
            </telerik:AjaxSetting> 
        </AjaxSettings> 
    </telerik:RadAjaxManager> 
    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Skin="Default">  
    </telerik:RadAjaxLoadingPanel> 
      
        <telerik:RadGrid ID="rgFollowups" runat="server" AllowSorting="True" GridLines="None" AllowAutomaticUpdates="True" 
            AutoGenerateColumns="False" OnDataBound="rgFollowUps_DataBound" OnItemDataBound="rgFollowUps_ItemDataBound" OnItemUpdated="rgFollowups_ItemUpdated" OnItemDeleted="rgFollowups_ItemDeleted">  
            <MasterTableView Width="100%" DataKeyNames="FollowupID"  Frame="Box" Height="550px" EditMode="InPlace">  
                <HeaderStyle Wrap="true" Height="25px"/>  
                <EditFormSettings  EditFormType="AutoGenerated" ColumnNumber="2" CaptionDataField="FollowupID" CaptionFormatString="Edit properties of Followup #{0}">  
                    <EditColumn ButtonType="LinkButton" InsertText="Insert Order" UpdateText="Update record" 
                        UniqueName="EditCommandColumn1" CancelText="Cancel edit">  
                    </EditColumn> 
                    <FormTableButtonRowStyle HorizontalAlign="Right" CssClass="EditFormButtonRow"></FormTableButtonRowStyle> 
                </EditFormSettings> 
                <Columns> 
                    <telerik:GridEditCommandColumn ButtonType="ImageButton" UniqueName="EditCommandColumn"  EditImageUrl="Styles/RDeditor/Img/editor.gif"/>  
                    <telerik:GridButtonColumn ConfirmText="Delete this Followup?" ConfirmDialogType="RadWindow" 
                        ConfirmTitle="Delete" ButtonType="ImageButton" CommandName="Delete" Text="Delete" 
                        UniqueName="DeleteColumn"  ImageUrl="Styles/RDeditor/Buttons/Cancel.gif"/>  
 
 
                    <telerik:GridHyperLinkColumn HeaderText="Follow Up" DataNavigateUrlFields="TransactionID" DataTextField="FollowupID" DataNavigateUrlFormatString="ViewFollowup.aspx?tran={0}"  Target="_blank"/>  
                    <telerik:GridBoundColumn ReadOnly="True" DataField="TransactionID" Visible="false"/>  
                    <telerik:GridBoundColumn HeaderText="Date" ReadOnly="True" UniqueName="colDate"  DataField="Date"/>  
                    <telerik:GridBoundColumn HeaderText="Time" ReadOnly="True" UniqueName="colTime" DataField="Time"/>  
                      
                    <telerik:GridTemplateColumn HeaderText="Reason">  
                        <EditItemTemplate> 
                            <asp:DropDownList ID="ddlReasons" runat="server" AutoPostBack="true" OnSelectedIndexChanged="ddlReasons_SelectedIndexChanged"></asp:DropDownList> 
                        </EditItemTemplate> 
                    </telerik:GridTemplateColumn> 
                    <telerik:GridBoundColumn HeaderText="Primary Seller" ReadOnly="True" UniqueName="colSeller" DataField="Seller"/>  
                    <telerik:GridBoundColumn HeaderText="Buyer" ReadOnly="True" UniqueName="colBuyer" DataField="Buyer"/>  
                    <telerik:GridHyperLinkColumn HeaderText="Property Address" UniqueName="colAddress" DataTextField="Address" DataNavigateUrlFields="TransactionID" DataNavigateUrlFormatString="Transaction.aspx?tran={0}" Target="_blank"/>  
                    <telerik:GridTemplateColumn HeaderText="Change Transaction Status" ItemStyle-HorizontalAlign="Center">  
                        <ItemTemplate> 
                            <asp:CheckBox ID="chkChgStat" runat="server" AutoPostBack="true" oncheckchanged="chkChgStat_OnCheckChanged"/>  
                        </ItemTemplate> 
 
<ItemStyle HorizontalAlign="Center"></ItemStyle> 
                    </telerik:GridTemplateColumn> 
                </Columns> 
                  
            </MasterTableView> 
            <ClientSettings> 
                <Scrolling AllowScroll="True" UseStaticHeaders="False" SaveScrollPosition="true" /> 
                <ClientEvents OnRowDblClick="RowDblClick" /> 
            </ClientSettings> 
        </telerik:RadGrid> 
        <telerik:GridDropDownListColumnEditor ID="GridDropDownColumnEditor1" runat="server" DropDownStyle-Width="125px" /> 
    <telerik:RadWindowManager ID="RadWindowManager1" runat="server">  
    </telerik:RadWindowManager> 
 
 
It makes no difference whether I use the GridDropDownColumn or a Grid TemplateColumn in this grid.  The confusinf thing for me is that I have a TemplateEdit in another place in this application, and so far the edit button works properly. 

Any Assistance would be greatly appreciated.

1 Answer, 1 is accepted

Sort by
0
Accepted
Pavlina
Telerik team
answered on 04 Feb 2010, 02:38 PM
Hello Andrew,

I followed your scenario in order to replicate the issue but to no avail. Please find attached a simple working application which handles the desired functionality. Examine it and let me know if it works for you.

I hope this helps.

All the best,
Pavlina
the Telerik team

Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Follow the status of features or bugs in PITS and vote for them to affect their priority.
Tags
Grid
Asked by
Andrew
Top achievements
Rank 2
Answers by
Pavlina
Telerik team
Share this question
or