Clarification in grid

I have an blazor syncfusion grid control in batch mode.

I have some clarification in grid..

1.How to prevent focusing on cell ( permanently lock the cell)

2.How to prevent focusing on cell based on condition

For example:

In my grid  there are three column 

A.
B
c

If  A value is greater than B value then prevent focusing on C column

3.How to change cell color based on condition 



5 Replies 1 reply marked as answer

JP Jeevakanth Palaniappan Syncfusion Team April 14, 2021 10:12 AM UTC

Hi Ismail, 
 
Greetings from Syncfusion support. 
 
Query 1: permanently lock the cell 
Query 2: If  A value is greater than B value then prevent focusing on C column 
 
We have checked the above two queries but we are quite unclear about the exact requirement. Did you mean(Permanently lock the cell means) to disable the editing action for particular cell? 
 
Kindly provide us a video demo regarding your requirement which will be helpful for us to provide you with a better solution as early as possible. 
 
Query 3: How to change cell color based on condition  
 
To customize cells, we suggest you to refer the below documentation 
 
 
Regards, 
Jeevakanth SP. 



KI KINS April 14, 2021 01:39 PM UTC

See my below comments...


1.permanently disabled means column

cell should be always read-only

2.Based on condition means,

If column "A" cell value is greater than 10 then Column "B" cell should prevent on Editing and focusing

Hope its clear


JP Jeevakanth Palaniappan Syncfusion Team April 15, 2021 12:53 PM UTC

Hi Ismail, 

Query 1: 

To prevent the editing for a column, we suggest you to set the AllowEditing of that particular GridColumn as false. Please refer the API reference below 


Query 2: 

To prevent the editing based on condition, we suggest you to set args.Cancel as true in OnCellEdit event based on your condition. Please refer the below code snippet and the sample for your reference. 

<SfGrid DataSource="@Orders" AllowPaging="true" Toolbar="@(new List<string>() { "Add", "Delete", "Update", "Cancel" })" Height="315"> 
    <GridEvents OnCellEdit="OnCellEdit" TValue="Order"></GridEvents> 
    <GridEditSettings AllowAdding="true" AllowEditing="true" AllowDeleting="true" Mode="EditMode.Batch"></GridEditSettings> 
.. 
</SfGrid> 
 
@code{ 
 
    public void OnCellEdit(CellEditArgs<Order> args) { 
        if (args.ColumnName == "CustomerID" && args.Data.OrderID > 1005) { 
            args.Cancel = true; 
        } 
    } 
} 




Regards, 
Jeevakanth SP. 


Marked as answer

KI KINS April 15, 2021 04:19 PM UTC

Thanks for reply....


JP Jeevakanth Palaniappan Syncfusion Team April 16, 2021 04:33 AM UTC

Hi Ismail, 

Thanks for the update. Get back to us if you have any other queries. 

Regards, 
Jeevakanth SP. 


Loader.
Up arrow icon