/// <reference path="~/GeneratedArtifacts/viewModel.js" />
/// <reference path="../Scripts/wijmo.cba.js" />

myapp.GridSelectionModes.FlexGrid_render = function (element, contentItem) {
    var grid = new c1.cba.FlexGrid($(element), contentItem);
    var collectionView = new c1.cba.LightSwitchCollectionView(contentItem);
    grid.wjControl.itemsSource = collectionView;
    screen.grid = grid.wjControl;
};

myapp.GridSelectionModes.SelectionMode_render = function (element, contentItem) {
    var selectCtr, selecthtml = '<select>\
                      <option value="None">None</option>\
                      <option value="Cell">Cell</option>\
                      <option value="CellRange" selected>CellRange</option>\
                      <option value="Row">Row</option>\
                      <option value="RowRange">RowRange</option>\
                      <option value="ListBox">ListBox</option>\
                    </select>';
    selectCtr = $(selecthtml).appendTo(element);
    selectCtr.on("change", function () {
        screen.grid.selectionMode = selectCtr.val();
    });
};