table rows add and remove

Posted by Suneel161 under jQuery on 6/6/2011 | Points: 10 | Views : 1985 | Status : [Member] | Replies : 2
<table id="tb1" runat="server">
<tr visible="false" id="tr1" runat="server"><td>One</td></tr>
<tr visible="false" id="tr2" runat="server"><td>Two</td></tr>
<tr visible="false" id="tr3" runat="server"><td>Three</td></tr>
<tr visible="false" id="tr4" runat="server"><td>Four</td></tr>
<tr visible="false" id="tr5" runat="server"><td>Five</td></tr>
</table>
Say all of them are invisible

Then I have a button to make them visible one by one, so if row 1 is invisible and I press the button then row 1 should be visible, if I press it again it sees that row 1 is already visible then it makes row 2 visible and so it goes on and on and on.




Responses

Posted by: Umeshdwivedi on: 6/6/2011 [Member] Starter | Points: 25

Up
0
Down
hallo
firt you tell you this event ocuur dynamicaly
if this event trigger on dynamic but you predefine table row
so clear you query what you actually want

Latest Technology Trainer
And Part time software consultant

Suneel161, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Ndebata on: 6/6/2011 [Member] Starter | Points: 25

Up
0
Down
Hi Suneel,
Try to use this namespace
using System.Web.UI.HtmlControls;
Then in aspx form add a button on which you want to show all rows one by one.
in code behind you can handle click event like this.
protected void btnShow_Click(object sender, EventArgs e)

{
foreach (HtmlTableRow item in tb1.Rows)
{
if (!item.Visible)
{
item.Visible = true;
break;
}
}
}

Thanks,
Debata

Suneel161, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response