BlazorWebFormsComponents
BlazorWebFormsComponents copied to clipboard
DataList: Simplify TableItemStyle elements
HeaderStyle, ItemStyle, etc parameter elements should not need a ChildContents container to be represented.
Currently the Markup needs
<DataList @ref="simpleDataList"
runat="server"
EnableViewState="false"
Context="Item"
ItemType="SharedSampleObjects.Models.Widget">
<ChildContent>
<BlazorWebFormsComponents.HeaderStyle BackColor="Blue" ForeColor="White"></BlazorWebFormsComponents.HeaderStyle>
</ChildContent>
<HeaderTemplate>Simple Widgets</HeaderTemplate>
<ItemTemplate>@Item.Id</ItemTemplate>
</DataList>
We would like to remove the need for the <ChildContent> tag
<ChildContent>
<BlazorWebFormsComponents.HeaderStyle BackColor="Blue" ForeColor="White"></BlazorWebFormsComponents.HeaderStyle>
</ChildContent>
and be able to use the HeaderStyle using the following more compatible format
<DataList @ref="simpleDataList"
runat="server"
EnableViewState="false"
Context="Item"
ItemType="SharedSampleObjects.Models.Widget">
<HeaderStyle BackColor="Blue" ForeColor="White"></HeaderStyle>
<HeaderTemplate>Simple Widgets</HeaderTemplate>
<ItemTemplate>@Item.Id</ItemTemplate>
</DataList>
Correct.. how could we support a child element with attributes?
DevNotes Blazor team commit for error message on Templated Components and test
I suspect this is another by design feature
Note the comment
Thanks for your feedback, @Venkat4655. We'll keep this in mind and will observe how the rest of the community reacts to the current design choice we've made. If we hear a lot of feedback similar to your, we will reconsider our approach. --
Link #1
Any updates on this?