Header Template

I setup a header template in a datagrid with a row with columns size md-2, md-4, md-2, md-4 putting labels inside each column for the header.


The problem though is that the when I run the grid, the header is looking like the following:

Hi @kgordon,

Not sure what you are trying to achieve. Can you post more info? Your current code and what is the expected result.

The grid is below. I have a Log table that shows basic high level details like date, who entered the log, subject of the log and then I have details which is more information. So what I've done is create a template inside a datagrid column that shows the high level details in one row and the details below. This works fine.

The issue though is that in the same template, I create a header row with the titles: Entry Date, Subject, Entered By, for some reason it's not rendering correctly. You can see that the title Subject is being placed on top of the title Entry Date, even though both have been put in their own separate divs. That's the section in light blue , the first row within the template, that isn't rendering correctly.

Here's a closer look at the problem
image

I'll email you the code for the grid cause it's too long for a picture, but here's the header template code that isn't showing correctly
image

Hi @kgordon,

I see now what you are after unfortunately the HeaderTemplate is rendered inside a SPAN and this will not work:

On the other hand you are using DataGrid with a single column - maybe you can use simply @foreach instead.

1 Like