VB.NET Javascript - Setting Table Row Styles when creating table

I'm trying to use this project in VB.NET: http://www.codeproject.com/Articles/29436/Expandable-panel-inside-a-GridView

The problem I'm having is on the table row ID:

My Project:

<tr id="gridStores" style="display:none;">

His:

<tr id="gridStores_linM_30" style="display:none;">

I'm losing the unique ID for the row so as a result it is hiding the entire table. So when the onClick event show / hide is being added, the unique ID is lost and it doesn't show / hide the correct row. Everything works if I edit the code in Firebug. This is called to add a new row to the table:

htmlTab.Controls.AddAt(newRowIndex, newRow)

Before that is called, when I called the client ID is: "linM_2"

Afterwards it is: "gridStores"

Why am I losing the name when the row is added? Is this behavior expected for some reason?

Thank you!

My Project: https://github.com/gbam/ExpandablePanel-VB

Working sample: http://www.apexlogikdata.com.br/ExpandPanelGridView/Default.aspx

Answers


This line of code fixed my problem:

    newRow.ClientIDMode = UI.ClientIDMode.Static

I'm not 100% sure I understand why it was needed and why VB.NET overrode my tabling naming. If someone can edit this answer and explain more about that, I would greatly appreciate it!

Thank you!


Need Your Help

Qt send file over TCP

qt file tcp

I doing TCP file client-server inside single application.