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

Unable to invoke insert row

1 Answer 88 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Brian
Top achievements
Rank 1
Brian asked on 09 Jun 2011, 11:38 PM
Using .NET 3.5 and C#. Trying to invoke the insert mode in my RadGrid. I have a FormTemplate set up. From the main page I call a popup window from which an item is selected that will govern the defaults for a new row in my RadGrid. The popup closes as follows:

 

        function TemplateSelected2() {
            if (window.opener != null && window.opener.StartNewLineItem != null) {

                // Call the parent window function to create a new line item
                if (templateID != "") {
                    window.opener.StartNewLineItem(templateID);
                }
                window.close();
            }
        }

 

 

 

Back on the main form, StartNewLineItem is meant to invoke the insert mode of the RadGrid
 

    function StartNewLineItem(templateID) {
        alert("start new line item");
        alert(templateID);

        // Start a new line item

        var tableView = $find("<%= RadGrid1.ClientID %>").get_masterTableView();
        tableView.IsItemInserted = true;
        tableView.rebind();

        // Copy values from the selected template into the new line item
        // <TODO>
        alert("after insert mode");
    }

 

The code runs without error, but does not put the RadGrid in Insert mode.

Is there a particular setting needed besides setting IsItemInserted=true and calling rebind() ?

Thanks.


 

1 Answer, 1 is accepted

Sort by
0
Tsvetoslav
Telerik team
answered on 13 Jun 2011, 04:17 PM
Hello Brian,

You need to fire the InitInsertCommand as shown in the following help article:
http://www.telerik.com/help/aspnet-ajax/grid-gridtableview-firecommand.html 

Greetings,
Tsvetoslav
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

Tags
Grid
Asked by
Brian
Top achievements
Rank 1
Answers by
Tsvetoslav
Telerik team
Share this question
or