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
555
AllowEdit=false only on single cell
posted

We want to change the AllowEdit-Mode based on the selected value in a XamComboEditor. The AllowEdit should only change in a single cell and not in the whole column. We tried to change the mode in the code-behind. But if we do so, all cells in this column are changed to AllowEdit=false. 

I've attached a sample project.

If you change the column "Status" to "ReadOnly" the cell "SecondName" shouldn't be editable and "SerienNummer" should be editable in the same row. 

XamDataGridSingleCellReadOnly.zip
Parents
No Data
Reply
  • 22015
    Verified Answer
    posted

    Hello maxitservice,

     

    Thank you for your post!

     

    I have been looking into you issue and have modified the sample application, that you have provided, for you.

    In the sample application I have handled the EditModeStarting. In the handler for this event I put the check, that you have made for the "Status" field and change it as follows:

    If the value of the combo is ReadOnly I cancel the editing of the cell for the SecondName and if the value is Editable I cancel the editing for the SerienNummer field.

     

    Regarding the style for the fields - I have created  one additional style for the CellValuePresenter. This way I have a separate styles for the two fields. In the styles I bind to the Status property of the data and change the background of the cell according to the value of the "Status" property.

     

    Please find the modified sample application and feel free to let me know if you have any further questions on this matter.

    XamDataGridSingleCellReadOnly_Modified.zip
Children