Copy codeThe Code is as follows:
<Asp: TemplateField HeaderText = "operation" ShowHeader = "False">
<ItemTemplate>
<Asp: LinkButton ID = "btn_zhiding" runat = "server" CommandName = "Tranfer" CommandArgument = '<% # Eval ("ARTICLE_ID ") %> 'text = '<% # Eval ("BeTop") = "TOP "? "Unpin": "TOP" %> 'oncommand = "RowCommand"> </asp: LinkButton>
<Asp: PlaceHolder ID = "PlaceHolder1" runat = "server" Visible = '<% # Eval ("BeTop") = "stick" %>'>
<Asp: ImageButton ID = "imgBtn_OrderUp" runat = "server" ImageUrl = "~ /Pic/forward to .jpg "CommandName =" OrderUp"
CommandArgument = '<% # Eval ("ARTICLE_ID") %> 'oncommand = "RowCommand"/>
<Asp: ImageButton ID = "imgBtn_OrderDown" runat = "server" ImageUrl = "~ /Pic/down to .jpg "CommandName =" OrderDown"
CommandArgument = '<% # Eval ("ARTICLE_ID") %> 'oncommand = "RowCommand"/>
</Asp: PlaceHolder>
</ItemTemplate>
<ItemStyle HorizontalAlign = "Center"/>
</Asp: TemplateField>
The control in each row of the GridView is dynamically displayed based on the bound value,
Use <asp: PlaceHolder runat = "server" Visible = '<% # Eval ("BeTop") = "stick" %>'>