asp.net - Loop through TableRow.Cells -


say have table this:

<html xmlns="http://www.w3.org/1999/xhtml" > <head id="head1" runat="server">     <title>tablecell example</title> </head> <body>     <form id="form1" runat="server">     <div>      <h1>tablecell example</h1>     <asp:table id="table1" runat="server"          cellpadding="3" cellspacing="3"         gridlines="both">         <asp:tablerow>             <asp:tablecell text="(0,0)" />             <asp:tablecell text="(0,1)" />             <asp:tablecell text="(0,2)" />         </asp:tablerow>         <asp:tablerow>             <asp:tablecell text="(1,0)" />             <asp:tablecell text="(1,1)" />             <asp:tablecell text="(1,2)" />         </asp:tablerow>     </asp:table>      </div>     </form>   </body> </html> 

how can value of cell in code. this:

for each row tablerow in objtable.rows   'how value of cell here id? next 

can cell value index?

use tablerow property called cells.
msdn:

gets collection of tablecell objects represent cells of row in table control.

the collection property returns instance of class called tablecellcollection has need methods , properties such item gets table cell object it's index.

also, can use foreach loop every tablecell in collection, did rows.

to tablecell's text have use it's property called... wait it... text


Comments

Popular posts from this blog

IF statement in MySQL trigger -

c++ - What does MSC in "// appease MSC" comments mean? -

javascript - Blogger related post gadget image Resize s72-c [ Need Expert Help ] -