Hi misters,
I have Datalist like this:
...
<HeaderTemplate>
<table cellpadding="0" cellspacing="0" id="tbl"><tbody>
</HeaderTemplate>
<ItemTemplate>
<tr id="<%# "filaListado" + Eval("idtareasworkflow") %>"
onclick="SelectRow('<%# Eval("idtareasworkflow") %>', <%# "'" +
Eval("Offset") + "'" %>);"
<%# EstiloFilaJavaScript(Container) %>
class="<%# Container.ItemIndex % 2 == 0 ? "ItemStyle" :
"AlternatingItemStyle" %>"
...
Now, it want to access to Row of Item Template. I put attribute runat=server.
I can't bind to ID property if it's runat=server, isn't?
I have this code, now:
<tr id="rowDatalist"
runat="server"
onclick="SelectRow ????"
How I implement my javascript function SelectRow ? Which parameters of js
function ? I want to access to row, but the id of TR is dynamic, isn't? It
would be neccesary something like similar ClientID.
any help for me? I will be grateful for any comments, help...
Thanks in advance, regards, greetings.

Signature
http://www.alhambra-eidos.es/web2005/index.html
www.kiquenet.net
www.trabajobasura.com/solusoft
Eliyahu Goldin - 20 Aug 2007 10:56 GMT
function selectRow(row){
// do here what you need, for example set a css style for the row background
}
<tr onclick="selectRow (this)">

Signature
Eliyahu Goldin,
Software Developer
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net
> Hi misters,
>
[quoted text clipped - 32 lines]
>
> Thanks in advance, regards, greetings.
Ladislav Mrnka - 20 Aug 2007 15:04 GMT
Hi,
I think you are using wrong component to achieve your requirements. You are
trying to render html table at your own, but DataList also renders its
content to html table. That means result of your page will not be HTML valid.
It will look like:
<table>
<tr>
<td>
<!-- here will be your header template -->
<table cellpadding="0" cellspacing="0" id="tbl"><tbody>
</td>
</tr>
<tr>
<td>
<!-- here will be your first item -->
<td>
...
</td>
</td>
</tr>
etc.
If you want to control table rendering at your own you have to use Repeater
control.
Regards,
Ladislav
> Hi misters,
>
[quoted text clipped - 31 lines]
>
> Thanks in advance, regards, greetings.