Hello, need a little help here.
For example, I have 4 column (A, B, C, D). If I want to edit, user only can edit column D. But if user add row, all column can be fill in.
How can I achieved that with IgniteUI 2016.2 and ASP.MVC 5 ?
Hello Johnson,
You can achieve this on editCellStarting event, where you can check whether the operation is rowadding or editing and based on that to cancel the event. For example:
editCellStarting: function(evt, ui) { if(ui.rowAdding) { return true; } else { if(ui.columnKey == "ProductID" || ui.columnKey == "Name") { return false; } } },
Attached is also a sample for your reference.
If you have any further questions, please let me know.
Regards,Tsanna
Tsanna"] Hello Johnson, You can achieve this on editCellStarting event, where you can check whether the operation is rowadding or editing and based on that to cancel the event. For example: editCellStarting: function(evt, ui) { if(ui.rowAdding) { return true; } else { if(ui.columnKey == "ProductID" || ui.columnKey == "Name") { return false; } } }, Attached is also a sample for your reference. If you have any further questions, please let me know. Regards,Tsanna
Done button become disabled with this solution when editing data in Row mode. Maybe because I allow all column to be added, but only 1 column I enabled to edit. Any solution?
Hello johnson,
In "row" edit mode there is no information about the columns, hence you can't check by respective column key. Therefore I would suggest you to use "cell" edit mode as demonstrated in the sample I attached previously.
If you have further questions, please let me know.
Regards,
Tsanna
But how can i show [done, cancel] button in cell editing mode? I think those button needed to give explicit available action for user than using enter.
You can use row edit mode along with editCellStarting event, so that Done and Cancel buttons to be enabled. And when you enter edit mode of some cell without modifying it, Done button won't be enabled until this cell value is changed. If you encounter different behavior than this, please send me a sample to test it on my side.