Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Display Table Row - Based on cell value

Status
Not open for further replies.

JoeZim

MIS
Sep 11, 2003
87
US
I have the following for each of 5 rows in a Table, which is within a FormView ItemTemplate:
Code:
<tr>
   <td style="width: 100px; color: green;">
      Exceptions:</td>
   <td style="width: 100px" align="center">      <asp:Label ID="lblExceptions" runat="server" Text='<%# Left(Eval("result"),1) %>'></asp:Label></td>
   <td style="width: 100px">
      <asp:LinkButton ID="lnkExceptions" runat="server"               Text="View Detail" OnClick="lnkExceptions_Click"></asp:LinkButton></td>
</tr>

The Left(Eval("result"),1) statement returns either "Y" or "N". If it returns "N", I am trying to hide the row. Any suggestions?

 
First, give the table row <tr> and ID and the runat='server' tag.
Code:
<td ID='test' runat='server'>....</td>
Then use the RowDataBound event of the FormView. In there, check your value as you described, and hide that row, based on your ID name, if you return an "N"

Jim
 
Thanks Jim, that got me moving in the right direction.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top