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

disable items of a foreign key column

1 Answer 242 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Vlad
Top achievements
Rank 1
Vlad asked on 04 Jun 2013, 08:03 AM
Do you know if it's possible to make some items of a dropdown list ( foreign key column) disabled and the rest enabled - based on a datasource property ?

1 Answer, 1 is accepted

Sort by
0
Petur Subev
Telerik team
answered on 06 Jun 2013, 07:04 AM
Hello Vlad,

I am afraid it is not possible to achieve such exact behavior.

You to bind to the select event of the ForeignKey dropdownlist and prevent the selection if the select item does not meet some requirement.

Here is an example:

$('#gridname').getKendoGrid().bind('edit',function(e){
         e.container.find('[data-role=dropdownlist]').data().kendoDropDownList.bind('select',function(a){
               if(a.item.text()=="some text of an item"){
                      e.preventDefault();
               }
        })
})

However this will not keep the DropDownList opened and it will also not make that particular item to look unselectable.

Regards,
Petur Subev
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
Vlad
Top achievements
Rank 1
Answers by
Petur Subev
Telerik team
Share this question
or