I use telerik grid in MVC
@(Html.Telerik().Grid<CSSI.VUE.Entities.ICW>()
.Columns(columns =>
{
columns.Bound(a => a.DRPDATA).Width(25).ClientTemplate("<#= DRPDATAtext #>").Title("manually/system");
columns.Bound(a => a.DATAVALUE.Width(15).Title("Amount ($)").HtmlAttributes(new { style = "text-align:right;" }).ReadOnly(true).Format("{0:###,##0.00}");
}
The first column is a yes / no drop-down list, and the second column is a text field with a read-only property. I want to change this if the user selects Yes in the first column, then the second text field of the column should not be read-only, the user can enter the amount manually. but if the user selects "No" from the drop-down list, the text field of the second column should be in read-only mode. the system will automatically take the amount from the database.
Is there a better way to get this feature, be it jQuery or MVC. please, help
I tried this with the jQuery function. but it does not work.
function Dropdown_onChange(e) {
var gridData = $('#elgrd').data("tGrid");
var column = gridData.columns[1];
column.readonly = false;
}