Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1115
Migrate from 2011.1 to 2012.1 client side code
posted

We change Infragistics.WebUI.UltraWebGrid.UltraWebGrid to Infragistics.Web.UI.GridControls.WebDataGrid. Now, we have problems with replacing.

How we can migrate this code?

var row = igtbl_addNew(gridName, 0);
var grid = igtbl_getGridById(gridName);
grid.clearSelectionAll();

SelectRow2(grid, grid.Rows.length-1);

igtbl_EnterEditMode(gridName);

function SelectRow2(grid, rowNum) {
alert("SelectRow2");
if ((grid.Rows.length > rowNum) && (rowNum >= 0))
{
grid.Rows.getRow(0).getCell(0).activate();
var row = grid.Rows.getRow(rowNum);
// Set the cell as the active cell
grid.setActiveRow(row);
row.setSelected(true);
}
}


Parents
  • 37874
    Verified Answer
    posted

    Hello Anton,

    This is how you can get reference to the grid and add new row client-side:

    var grid = $find("WebDataGrid1");

    // Create array of cell values for all values that cannot be null.

    var row = new Array("CustomerID", "CompanyName");

    // Add row.

    grid.get_rows().add(row);

    Clear selection:

    grid.get_behaviors().get_selection().get_selectedRows().clear();

    or

    grid.get_behaviors().get_selection().get_selectedCells().clear();

    Enter edit mode:

    grid.get_behaviors().get_editingCore().get_behaviors().get_cellEditing().enterEditMode(gridCell);

    Set active cell:

    grid.get_behaviors().get_activation().set_activeCell(gridCell);

    Select a row:

    grid.get_behaviors().get_selection().get_selectedRows().add(row);

    Here is the CSOM reference for WebDataGrid - http://help.infragistics.com/NetAdvantage/ASPNET/2012.1/CLR4.0/?page=WebDataGrid~Infragistics.Web.UI_namespace.html.

Reply Children