What's the difference between Content and ContentTemplate?

I don't know if this applies to other controls, but especially in a SfGrid, I have both tags available. When is it desirable to use which? For example:


<SfGrid DataSource="@Data" @ref="@Grid" AllowGrouping="true" AllowSorting="true">

    <ContentTemplate> <!-- Why use this instead of <Content>?? -->

    </ContentTemplate>

</SfGrid>


3 Replies

SP Sarveswaran Palani Syncfusion Team September 13, 2022 04:58 PM UTC

Hi Coda,


Greetings from Syncfusion support.


We have analyzed your query and we didn’t have support for ContentTemplate in SfGrid. We have support for columnTemplate only, which is used to display the customized records to the Grid. Kindly refer the attached documentation for your reference.


Reference: https://blazor.syncfusion.com/documentation/datagrid/column-template

https://blazor.syncfusion.com/documentation/datagrid/templates#gridtemplates-component


Kindly get back to us if you have any further queries


Regards,

Sarveswaran PK



CE Coda Error Analysis September 13, 2022 05:44 PM UTC

I apologize, my post was unclear - I meant to say SfDashboardLayout instead of SfGrid...  <ContentTemplate> works as an element inside of an DashboardLayoutPanel.  But, <Content> works as well.  So, for example:

<SfDashboardLayout ...>

<DashboardLayoutPanel...>

     <ContentTemplate>

        <div class="panel-content">

             This is my stuff

        </div

     </ContentTemplate>

</DashboardLayoutPanel>

</SfDashboardLayout>


...produces the same as:


<SfDashboardLayout ...>

<DashboardLayoutPanel....>

     <Content>

        <div class="panel-content">

             This is my stuff

        </div

     </Content>

</DashboardLayoutPanel>

</SfDashboardLayout>




IL Indhumathy Loganathan Syncfusion Team September 15, 2022 03:54 PM UTC

Hi Coda,


Yes, we have both the Content and ContentTemplate APIs, and they work similarly. But we will deprecate one of the APIs soon. We suggest you use one of the tags to render panel content for the Dashboard Layout panels. Please let us know if you need any further assistance.


Regards,

Indhumathy L


Loader.
Up arrow icon