Thursday, 9 August 2012

Use Eval Function in Visible Property



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 :


  1. Find Button control in RowDataBound or RowCreate event 
  2. Check Condition to Hide Button 
  3. 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

What should you required to learn machine learning

  To learn machine learning, you will need to acquire a combination of technical skills and domain knowledge. Here are some of the things yo...