Skip to content

use ContentControl with template for TemplateColumn - #214

Merged
w-ahmad merged 1 commit into
mainfrom
tempalte_issue_fix
Sep 11, 2025
Merged

w-ahmad merged 1 commit into
mainfrom
tempalte_issue_fix

Conversation

@w-ahmad

@w-ahmad w-ahmad commented Sep 7, 2025

Copy link
Copy Markdown
Owner

Fixes #188 and might also address #211.

This PR updates the way cell content is loaded in a template column. Previously, the content was manually set after loading the template using DataTemplate.LoadContent(), which caused issues with x:Bind and Binding.Converters. The new approach uses a ContentControl with the cell template, which is then used as the cell content.

@w-ahmad w-ahmad changed the title create ContentControl with template for TemplateColumn use ContentControl with template for TemplateColumn Sep 8, 2025
@w-ahmad
w-ahmad requested a review from Copilot September 11, 2025 11:23

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes issues with data binding in template columns by replacing direct template content loading with ContentControl-based rendering. The change ensures that x:Bind and Binding.Converters work correctly in template columns by leveraging the proper data binding infrastructure.

  • Updated GenerateElement to use ContentControl with ContentTemplate instead of DataTemplate.LoadContent()
  • Updated GenerateEditingElement to use the same ContentControl approach for editing templates
  • Maintains existing fallback behavior when editing templates are not defined

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment thread src/Columns/TableViewTemplateColumn.cs
Comment thread src/Columns/TableViewTemplateColumn.cs
@w-ahmad
w-ahmad merged commit 29a937c into main Sep 11, 2025
1 check passed
@w-ahmad
w-ahmad deleted the tempalte_issue_fix branch September 11, 2025 11:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Issue using TableViewTemplateColumn

2 participants