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

How to bind Grid Commands to MVVM attributes

2 Answers 159 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Grant
Top achievements
Rank 3
Iron
Iron
Veteran
Grant asked on 22 Jun 2018, 09:32 AM

Hi there, 

So as my title says Im trying to bind an MVVM attribute to a Grid command button, its a custom command if that makes a difference. The reason being is that one of my commands is to 'Setup' a record, but setting up a record is dependent on the status of another field that is in the MVVM.

Please advise on how I can proceed, I see there have been a few post about this a couple years ago before without resolution. Everyone just seems to be falling back to using jQuery, but i dont want to have to do that.

Thanks,
Grant

2 Answers, 1 is accepted

Sort by
0
Georgi
Telerik team
answered on 26 Jun 2018, 08:18 AM
Hi Grant,

Based on the provided information I assume that the requirement is to bind a certain attribute of the custom command to a field of the model. Please correct me if I am wrong.

A possible solution is to use Attribute Binding:


Below you will find a small sample which demonstrates how to bind an attribute of a custom command to a field of the model:



Regards,
Georgi
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Grant
Top achievements
Rank 3
Iron
Iron
Veteran
answered on 26 Jun 2018, 09:03 AM

Morning Georgi, 

Thanks so much, this is great.Its very similar to what im trying to do, but it answers my question perfectly.

Regards,
Grant

Tags
General Discussions
Asked by
Grant
Top achievements
Rank 3
Iron
Iron
Veteran
Answers by
Georgi
Telerik team
Grant
Top achievements
Rank 3
Iron
Iron
Veteran
Share this question
or