Hello team,
hope you are well.
I have an urgent requirement. I am trying to have checkboxes in one of the dynamically generated columns. So I use the following code in the attached sample:
CheckBox check1 = new CheckBox();check1.IsChecked = true;
employee.SecondName = check1;
Employees.Add(employee);
But when I run the application I get a string value in the xamdatagrid cell instead of the actual checkbox. Please advise how to resolve this. Thank you.
Best regards,
Sherif
How can i get checked/unchecked value with row and column header name?
Hello Sherif,
Thank you for your feedback. I am glad that you resolved your issue and I believe that other community members may benefit from this as well.
Thanks again.
Thank you for your help.
Since all your data is generated dynamically and the properties are determined dynmically, too, the XamDataGrid cannot map its Fields with string values, so if you want to change this, you should explicitly set the Field's EditorType Property.
Hello Stefan,
Thank you for your reply. However, I don't think this will work for my case. Can this be done without setting the xamdatagrid field types?
In my case, I have a xamdatagrid which populates a number of rows. All these rows are expandable, thus, once you click on a row, a number of subrows will be displayed under the parent row. The number of columns varies for subrows under each parent row. So one parent row, can have a number of subrows with only the second name column, while another parent row might have subrows with secondname, thirdname, fourthname, etc... Therefore I dont think I can solve it by setting the properties of the xamdatagrid, because the number of boolean columns in subrows will vary for each parent row within the same xamdatagrid. Please advise what should be done.
Thank you Stefan, your assistance is truly appreciated.