This is a migrated thread and some comments may be shown as answers.

Extra Code in Grid Row

1 Answer 21 Views
Grid
This is a migrated thread and some comments may be shown as answers.
michael schneider
Top achievements
Rank 1
michael schneider asked on 27 Nov 2013, 05:00 PM

Hello,

I have  a dynamically created RadGrid. The HTML output for each row looks like that:

<tr class="rgRow" id="Tr1">
 <td>

 </td>
</tr>

Now I want to inject some extra code next to the tr-tag in each gridrow:

<tr itemscope itemtype="http://schema.org/Product" class="rgRow" id="Tr1">
 <td>

 </td>
</tr>

Any ideas?

Best regards
Bernie

1 Answer, 1 is accepted

Sort by
0
michael schneider
Top achievements
Rank 1
answered on 28 Nov 2013, 10:05 AM
Hello,

okay, I found a solution, quite simply:
on    ItemCreated  you have to add:
if (e.Item is GridDataItem)
{
 GridDataItem dataItem = e.Item as GridDataItem;
 dataItem.Attributes.Add("itemscope itemtype", "http://schema.org/Product");
}


the HTML result is:

    <tr class="rgRow" id="Tr1" itemtype="http://schema.org/Product" itemscope="">

but I need this:

    <tr class="rgRow" id="Tr1" itemscope itemtype="http://schema.org/Product" >

Any ideas?
Best regards
Bernie





Tags
Grid
Asked by
michael schneider
Top achievements
Rank 1
Answers by
michael schneider
Top achievements
Rank 1
Share this question
or