New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added support for binding to sub-objects in ComboBoxColumn #2919
Added support for binding to sub-objects in ComboBoxColumn #2919
Conversation
@RBrid Would you be able to review this pull request for me? |
@RBrid Hi Regis, would you have time to look at this one please? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the long delay Filip. There is already a file with a bunch of type utility functions: ...\WindowsCommunityToolkit\Microsoft.Toolkit.Uwp.UI.Controls.DataGrid\Utilities\TypeHelper.cs
- Can you please check if any of those methods can be used instead of yours?
- Any new method should be added to that file (if any is still required) instead of DataGridComboBoxColumn.cs. And if you add some to that file it's better to make them bullet proof with input parameter checks.
Thanks!
@rbird Thanks for the comments. Will look in to it next week and replace with methods from TypeHelper.cs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for looking into this Filip.
Microsoft.Toolkit.Uwp.UI.Controls.DataGrid/DataGrid/DataGridComboBoxColumn.cs
Outdated
Show resolved
Hide resolved
Microsoft.Toolkit.Uwp.UI.Controls.DataGrid/DataGrid/DataGridComboBoxColumn.cs
Outdated
Show resolved
Hide resolved
Microsoft.Toolkit.Uwp.UI.Controls.DataGrid/DataGrid/DataGridComboBoxColumn.cs
Outdated
Show resolved
Hide resolved
Microsoft.Toolkit.Uwp.UI.Controls.DataGrid/DataGrid/DataGridError.cs
Outdated
Show resolved
Hide resolved
Microsoft.Toolkit.Uwp.UI.Controls.DataGrid/DataGrid/DataGridComboBoxColumn.cs
Outdated
Show resolved
Hide resolved
Microsoft.Toolkit.Uwp.UI.Controls.DataGrid/DataGrid/DataGridComboBoxColumn.cs
Outdated
Show resolved
Hide resolved
Microsoft.Toolkit.Uwp.UI.Controls.DataGrid/Utilities/TypeHelper.cs
Outdated
Show resolved
Hide resolved
Microsoft.Toolkit.Uwp.UI.Controls.DataGrid/Utilities/TypeHelper.cs
Outdated
Show resolved
Hide resolved
Microsoft.Toolkit.Uwp.UI.Controls.DataGrid/Utilities/TypeHelper.cs
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the changes Filip.
@michael-hawker Any chance of getting another reviewer to approve this pull request? :) |
@filipwa84 sorry this fell off my radar with the holidays. Régis' approval is the main gate, looks good to me. Is there anything in the sample page that should be updated to show off this new feature? |
@michael-hawker Nothing that needs to be shown in the sample app in my opinion. The added functionality just adds the possibility to bind to sub-objects which is an expected behavior. |
@filipwa84 sorry for the delay on this, any advice on framing for testing this feature? Also, it appears there's a merge conflict now, would you mind resolving? Thanks! |
@michael-hawker I'll take a look at it |
@michael-hawker The merge conflict is resolved. Regarding testing, you can just verify that the column's Binding property can be bound to a property within a sub-object. For example:
where MySubModel is a "sub-object" inside MyModels which has a property called DisplayId which we are matching to a property with the same name inside Displays. |
@michael-hawker any chance of getting this merged? :) We rely on this being fixed in our project... |
@filipwa84 yup, I'll get this merged for 6.1, just haven't had time to test things out, thanks for the example. I'll use that and take a look, thanks a bunch! |
Thanks for the contribution @filipwa84! Sorry this took so long to merge and missed the last release. It'll be 6.1 though! 🎉🎉🎉 |
@michael-hawker Thank you. Just a quick question, should this be available in the NuGet preview package now? Tried to install 6.1 preview but it seemed like it wasn't there... |
@filipwa84 I think this was merged after we did the preview package for //Build. You can grab it from MyGet, those are updated as soon as it gets merged to Master automatically. 6.1 should ship on Monday though! 🤞 Thanks again for this contribution! 🎉🎉🎉 |
Issue: #2738
PR Type
What kind of change does this PR introduce?
What is the current behavior?
Binding cannot be bound to sub-objects and throws an exception.
What is the new behavior?
Support for binding to sub-objects has been added.
PR Checklist
Please check if your PR fulfills the following requirements:
Other information