We can also come to a situation where we need to Hide a button inside Gridview,DataList or Reapeter on certain condition .
For that you may follow below steps :
- Find Button control in RowDataBound or RowCreate event
- Check Condition to Hide Button
- Then Set Visible property of that button
But you can do this on your aspx page itself only.
Using Following Code.
<asp:Button ID="btnDelete" runat="server" Text="Delete" Visible='<%#Convert.ToInt32(Eval("StudentId")) != 0 %>' />
No comments:
Post a Comment