Vikas Ahlawat

Vikas Ahlawat

  • NA
  • 564
  • 817k

How hide Gridview template filed according condition?

Feb 10 2011 2:36 AM
I have the following gridview

                </asp:GridView>
                 <asp:GridView ID="GridViewDirect" runat="server" AutoGenerateColumns="false">
                <Columns><asp:TemplateField><ItemTemplate>
                <div id="block4">
                    <h3>Flight Details</h3>
                    <div id="b1k4-inner2">
                        <ul class="block-info1">
                            <li class="one"><asp:ImageButton ID="ImageButton2" runat="server" ImageUrl='<%# "~/shivtravel_admin/images/AirlineLogo/" +Eval("Leg1AirlineLogo")%>'  /> </li>
                            <li class="two"><%#Eval("Leg1From")%><br />Terminal: <%#Eval("Leg1DepTerminal")%><br /> <%#Eval("Leg1DepDate")%> at <%#Eval("Leg1DepTime")%> <br />Flight No: <%#Eval("Leg1Carrier")%><%#Eval("Leg1FltNo")%></li>
                            <li class="three"><%#Eval("Leg1To")%> <br /><%#Eval("Leg1ArrDate")%> at <%#Eval("Leg1ArrTime")%> <br /></li>
                            <li class="four">Aircraft:<br />Duration:<br />Cabin:<br />Meals:</li>
                            <li class="five"><%#Eval("Leg1Equip")%><br /><%#Eval("Leg1Time")%><br /><%#Eval("Leg1ECabin")%><br /><%#Eval("Leg1MealCode")%></li>                         
                        </ul>
                    </div>
                  
</div>
</ItemTemplate></asp:TemplateField></Columns>
                </asp:GridView>


IN this I want to hide   "Flight No: "  according to condition , how can i hide this?(i will take it as label)


Answers (2)