Now I just wat to change "AllowEdit = true" into "AllowEdit = false" for specific Cell in the source code.
First I tried like the following .
CellValuePresenter.FromCell((xamDataGrid1.Records[5] as DataRecord).Cells[0] as Cell).Field.Settings.AllowEdit = false;
but It made all cells having 0 index of records un-editable.
In the brief , I Just want to set the property "AllowEdit" to false for one or specific cell not all records cell.
Thanks in advance.
This is because you are setting this property to the FieldSettings, which will apply to all of the cells in that field. You have to set this locally - on the CellValuePresenter itself and the editor actually.
You can do that like this:
CellValuePresenter cvp = CellValuePresenter.From....
cvp.Editor.IsReadOnly = false;
Please let me know if you have questions on this.
I would like to know how this can be bound in XAML without having to write any C# and just bind a specific cell's AllowEdit property. I have tried binding the FieldSettings.AllowEdit to a property in my ViewModel, and yes, it sets the "AllowEdit" for the entire column based off of another neighboring column's Checkbox being checked (only the first one though!). I just would like this one specific cell to have the AllowEdit change applied, not the Field. How do I specify something along the wishful syntax of <igDP:RowSetting.AllowEdit> somewhere? I super appreciate your response!!!
Hi,
I need help please, i want to do an specific row of my XamDataGrid allow to edit, i am using this command:
Me.xdgOrdenes.Records(2).FieldLayout.FieldSettings.AllowEdit = True
But all the records (rows) are available to edit, can you help me please to do just one specific row available to edit.
Thank you.
Hello Kathleen,
If you want to be able to edit a single Record, based on a condition, you can handle the XamDataGrid’s EditModeStarting event and determine whether to cancel it or not. I attached a sample project for you showing you how to do so. Please let me know if you need more clarifications on this matter.
Looking forward for your reply.