The Syncfusion native Blazor components library offers 70+ UI and Data Viz web controls that are responsive and lightweight for building modern web apps.
.NET PDF framework is a high-performance and comprehensive library used to create, read, merge, split, secure, edit, view, and review PDF files in C#/VB.NET.
How do I set some columns in an inline grid to be read only when adding a record? One of the columns in the grid has an edit type dropdown, the read only column value will be based on the value selected in the dropdown.
ARAjith R Syncfusion Team January 15, 2016 03:50 AM UTC
Hi Lory,
Thanks for using Syncfusion products.
Query 1:How do I set some columns in an inline grid to be read only when adding a record? We suggest you to set allowEditing as false to the specific column to achieve the read only operation while adding new record in the Grid. Please refer the below code snippet for further details.
Query 2:One of the columns in the grid has an edit type dropdown, the read only column value will be based on the value selected in the dropdown.
We suggest you to use actionBegin client side event and check requestType as save then assign the read only column value in args.data based on the drop down column value to achieve your requirement. Please refer the below code snippet for further details.
$("#Grid").ejGrid({
---------
---------
actionBegin:function (args) {
if (args.requestType == "save") {
if (args.data.EmployeeID < 4) // check drop down column value
args.data.CustomerID = "ADAMS"; // set read only column value
else
args.data.CustomerID = "EVES";
}
} });
Please refer the below sample for further details.