Hide addnew button

2 posts, 0 answers
  1. lakmal
    lakmal avatar
    76 posts
    Member since:
    Jun 2009

    Posted 20 Feb 2010 Link to this post

    Hi,

    How can i hide and show addnew Button in run time?

    lakmal
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 21 Feb 2010 Link to this post

    Hello Lakmal,

    The code snippet shown below will help you in showing/hiding the "Add New Record" button in CommandItem.

    C#:
     
        protected void Button1_Click(object sender, EventArgs e) 
        { 
            GridCommandItem cmdItem = (GridCommandItem)RadGrid1.MasterTableView.GetItems(GridItemType.CommandItem)[0]; 
            // cmdItem.FindControl("AddNewRecordButton").Parent.Visible = false; // Hide the buttons 
            cmdItem.FindControl("AddNewRecordButton").Parent.Visible = !cmdItem.FindControl("AddNewRecordButton").Parent.Visible; 
        } 

    -Shinu.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top