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

Want/neet to always show dropdowns and checkboxes

1 Answer 60 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Joe
Top achievements
Rank 1
Joe asked on 10 Feb 2017, 06:23 PM
When I load data into a grid via a DataSourceRequest based Read action, I would like a column to always show a dropdown.  As it stands currently, in my limited experience, you either have to double click a row for InCell editing or click an Edit button for the PopUp editor, all interaction with the DataSourceRequest based Update action.  But I don't want my users to have to clikc a button, nor double click a row.  How can I show a dropdown in a specific column, for all rows without having to activate an edit mode?  Is it possible?  And I assume, I would have to use the Batch mode?

1 Answer, 1 is accepted

Sort by
0
Konstantin Dikov
Telerik team
answered on 14 Feb 2017, 09:20 AM
Hello Joe,

Editors in ClientTemplate are not officially supported, but you can use MVVM initialization and binding to achieve it. For your convenience, following is a simple example demonstrating how to bind a checkbox:
       columns.Template(@<text></text>)
.ClientTemplate("<input type='checkbox' class='checkBoxClass' data-bind='checked: fldGreenTag'/>")
.Width(100);

And within the DataBound event you need to bound the input elements to the model:
function dataBound(e) {
    var grid = this;
    grid.element.find("[role='row']").each(function () {
        var tr = $(this).closest('tr');
        var item = grid.dataItem(tr);
        kendo.bind($(this), item);
    });
}


Best Regards,
Konstantin Dikov
Telerik by Progress
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
Grid
Asked by
Joe
Top achievements
Rank 1
Answers by
Konstantin Dikov
Telerik team
Share this question
or