Current filter:
                                You should refresh the page.
                                  • Hello!

                                    I'm following your article on Binding to a collection of columns.

                                    In my application, I'd like to have the cell of a column to be read only based on a property of the item shown in the row (specifically: the cell should be editable for new records but not for existing ones).

                                    My idea was to provide a boolean property "ReadOnlyIfNotNew" in the Column class (from your example) and then use this value in an attached property which would set the binding for the cell.

                                    But alas I don't know how to get this done. Could you please help me further?

                                    Thank you very much in advance

                                1 Solution

                                Creation Date Importance Sort by

                                Hi Markus,

                                We recently published the Disable Editing topic with different ways to make cells read-only. I suggest you use it to choose between the available approaches based on your current task.

                                Since you need to disable editing for individual cells, use the ShowingEditor event. Its arguments provides information about the current row and column, so you can implement any rule you want. If you want to avoid code-behind event handlers, create a custom Behavior class for your TableView and handle the ShowingEditor event there.


                                • Markus Nißl 10.15.2019

                                  Thank you very much!