Does anyone have a sample application on adding/removing dynamic columns from a XamDataGrid? I have 5 fixed column then I want to Dynamically add or remove checkbox columns from the end of the Grid. How can i achieve this?
Example:
Hello Rahul,
Thank you for your post!
In order to add and remove checkbox columns to the XamDataGrid dynamically, I would recommend creating a CheckboxField object and adding it to the Fields collection of one of the FieldLayouts of the XamDataGrid. Note, you will need a property path to associate its Name with if you want to have it bound to your underlying data item, but you can also create unbound ones like is demonstrated in the attached sample project.
I hope this helps you. Please let me know if you have any other questions or concerns on this matter.
XDGAddAndRemoveColumns.zip
Hi Andrew,
Thanks for your reply.
In my case I have a entity class suppose Employee and I am going to display Employees in first column of grid. and each employee has a property of type bitwise enums based on that I am going to generate columns dynamically if those bits are set
How can I achieve this and how can I get values of row in here employee and column name if it is checked or unchecked.
I would just like to ensure that I understand the structure of the columns that you are looking to achieve in this case. It sounds like you want to have something about your Employee object in column 1, but I’m trying to understand the bitwise enums part. Are you saying that you have a List<enum> or something along those lines, and you are looking to have a Field for list[0], list[1], list[2] and so on?
Can you please elaborate a little further on exactly the structure you are looking to achieve? If you have an isolated sample project that shows this structure, that would also be welcomed in this case.
Please let me know if you have any other questions or concerns on this matter.