mark a row

Results 1 to 3 of 3

Thread: mark a row

  1. #1
    Join Date
    Dec 1969

    Default mark a row

    I am using a foreach loop to browse thru the rows of a datatable example is below <BR><BR>foreach(DataRow r in myTable.Rows) <BR>{ <BR>statement; <BR>} <BR><BR>I am executing some code(given as statement) for each row.In the statement section I am using an if condition to check something. <BR>And if the &#039;if&#039; condition satisfies I want to get the row number of that do I get that? <BR>Thats because if the &#039;if&#039; condition satisfies I want to colour that row in the datagrid(bound by myTable) or maybe mark that row in the datagrid,whichever is possible. <BR>Many Thanks..

  2. #2
    Join Date
    Dec 1969

    Default RE: mark a row

    just put declare <BR>int i = 0;<BR>then u can just get it<BR>

  3. #3
    Join Date
    Dec 1969

    Default use a for loop

    for(int i = 0; i &#060; myTable.Rows.Count; i++)<BR>{<BR> if (something)<BR> {<BR> Response.Write("condition met for row " + i.ToString());<BR> Response.Write("&#060;br /&#062;");<BR> }<BR>}

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts