Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
95
Change the value of AllowEdit for a specific cell
posted

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.

 

 

 

 

 

 

Parents
No Data
Reply
  • 69686
    Suggested Answer
    posted

    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.

Children