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

Am I editing first row?

1 Answer 141 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Ed
Top achievements
Rank 1
Ed asked on 29 Feb 2016, 11:33 PM

I'm doing some inline editing in the grid. If I'm in the first row, the first columns must have a static text instead of a dropdownlist.

How can I determine if I'm in that first row and then make that cell static text or dropdownlist? I've got the dropdownlist working fine, I just need to swap out the template based on which row it is.

1 Answer, 1 is accepted

Sort by
0
Accepted
Alexander Popov
Telerik team
answered on 02 Mar 2016, 09:20 AM
Hi Ed,

Try subscribing to the Grid's edit event. Once it is triggered, you can get the the index the row and determine whether to replace the DropDownList with a static text. For example: 
function onEdit(e) {
    if(e.container.index() == 0) {
        e.container.first("td").text("hello");
    }
}


Regards,
Alexander Popov
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
Grid
Asked by
Ed
Top achievements
Rank 1
Answers by
Alexander Popov
Telerik team
Share this question
or