<SfGrid DataSource="@inspectGrid"
GridLines="GridLine.Both"
Toolbar="@(new List<string>() {"Update", "Cancel"})">
<GridEvents OnBatchSave="BatchSaveHandler" RowSelecting="RowSelectingHandler"
CellSelecting="CellSelectingHandler" RowSelected="RowSelectedHandler"
QueryCellInfo="QueryCellInfoHandler"
TValue="Inspection" />
<GridEditSettings AllowAdding="true"
AllowDeleting="true"
AllowEditing="true"
Mode="EditMode.Batch" />
<GridColumns>
<GridColumn Field=@nameof(Inspection.PriInspectionId) IsPrimaryKey="true" AutoFit="true" />
<GridColumn Field=@nameof(Inspection.Icolumn1) AutoFit="true" />
<GridColumn Field=@nameof(Inspection.Icolumn2) AutoFit="true" />
<GridColumn Field=@nameof(Inspection.Icolumn3) AutoFit="true" />
<GridColumn Field=@nameof(Inspection.Icolumn4) AutoFit="true" />
<GridColumn Field=@nameof(Inspection.Icolumn5) AutoFit="true" />
<GridColumn Field=@nameof(Inspection.Icolumn6) AutoFit="true" />
<GridColumn Field=@nameof(Inspection.Icolumn7) AutoFit="true" />
<GridColumn Field=@nameof(Inspection.Icolumn8) AutoFit="true" />
<GridColumn Field=@nameof(Inspection.OrderNo) Visible="false" AutoFit="true" />
<GridColumn Field=@nameof(Inspection.RecType) Visible="false" />
<GridColumn Field=@nameof(Inspection.MediaFileUrl) AutoFit="true" />
</GridColumns>
</SfGrid>
<style>
.e-grid .e-gridheader .e-columnheader {
display: none;
}
.e-grid .e-gridcontent .e-rowcell.Head1 {
background-color: lightskyblue;
font-weight: bold;
}
</style>
public void RowSelectingHandler(RowSelectingEventArgs<Inspection> args)
{
if (args.Data.RecType.Trim() == "HEAD") //we ahve prevented the row selection for order id --1004
{
args.Cancel = true;
}
}
public void CellSelectingHandler(CellSelectingEventArgs<Inspection> args)
{
args.Cancel = true;
}
public void RowSelectedHandler(RowSelectEventArgs<Inspection> args)
{
args.Cancel = true;
}
My requirement is make the one complete row as read only or disable editable row, But i m using Mode="EditMode.Batch" in Grid. I tried the above syntax. It is not working.