1
votes

How can i get radgrid insert items from clientside. I have used the following code, but its not working.

            var mode = rgBoxLimits.get_isItemInserted();
            var insertItems;
            var dpToDate;
            if (mode) {
                insertItems= rgBoxLimits.get_insertItem();
                dpToDate = insertItems[0].findElement("dtToDate");  //Not working
            }

For edit items, i have the following code and its working fine.

                var editedItems = rgBoxLimits.get_editItems();
                var dpToDate = editedItems[0].findElement("dtToDate");
1

1 Answers

-1
votes

The problem is that you are running the get_isItemInserted() and get_insertedItem() method on a RadGrid object, while they are methods for a GridTableView object. See the RadGrid Documentation for more info.

Try this:

function getItems(sender, args) {
    var myRadGrid = document.getElementById("MainContent_RadGrid1");
    var grid = window.$find("MainContent_RadGrid1");

    var mode = grid.get_masterTableView().get_isItemInserted();
    mode = true;
    var insertItems;
    var dpToDate;
    if (mode) {
        insertItems = grid.get_masterTableView().get_insertItem();
        dpToDate = insertItems[0].findElement("dtToDate"); //Not working
    }
}