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

Disabling colums or single gridcells/td's possible

1 Answer 123 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Heike
Top achievements
Rank 1
Heike asked on 30 Jan 2014, 03:29 PM
Hi,

we've built a two-column grid where only the cells in the second column should be editable.
The text in the cells of the first column cannot be edited, but the row can be selected as well as the cells in the first column can be accessed by mouse and keyboard which is very annoying as the should be ignored when navigating by keyboard and not selectable by mouseclick.

They should behave like let's say a cell in the table header as it cannot be clicked and selected.

Is there a way to achieve this?

I've enclosed a screenshot to describe in detail what the problem is... the column with the red arrow is not editable und should therefore be not selectable and thus white,  and the cells in the red brackets are editable.

Cheers,
Heike

1 Answer, 1 is accepted

Sort by
0
Dimiter Madjarov
Telerik team
answered on 31 Jan 2014, 09:17 AM
Hi Heike,


There is no built in way to define which columns should be selectable and which not. Nevertheless, you could implement this by binding to the change event of the Grid, which is fired, when the selection has changed and remove the k-state-selected class from the first column cells.
E.g.
function onChange(e) {
    var selection = this.select();
    selection.each(function () {
        if ($(this).index() === 0) {
            $(this).removeClass("k-state-selected");
        }
    });
}

Please let me know if this was the information that you were looking for.

Regards,
Dimiter Madjarov
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
Heike
Top achievements
Rank 1
Answers by
Dimiter Madjarov
Telerik team
Share this question
or