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
545
xamDataGrid: Combining string columns with run-time dynamic number of checkbox columns.
posted

Hi!

I'm trying to create a xamDataGrid with a couple of read-only string columns and a dynamic number of checkbox columns. I also want to be able to select multiple checkbox cells and edit them all simultaneously e.g. by pressing spacebar or something. At the moment I am able to create the string and checkbox columns by setting the DataSource to a DataTable created in the ViewModel. I have to set typeof(string) and typeof(bool) for the DataColumns. The problem now is that I no longer have a reference to the underlying object in the xamDataGrid. It only has string/bool values. I have one object per checkbox cell, not one object per row. The string columns are special fixed columns.

How can I create a dynamic number of rows/columns with checkbox cells bound to a bool property on my objects, one object per checkbox cell. Do I have to use events and override the FieldLayout stuff? I also need multiselection of checkbox cells to be able to check/un-check all selected checkboxes.

- Atle