This is a migrated thread and some comments may be shown as answers.

[Solved] Add new Record file icon still showing

1 Answer 86 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Damian
Top achievements
Rank 1
Damian asked on 25 Jun 2008, 04:50 AM
Hi, running the web2.0 skin with the newest radgrid. implemented the following code to remove the "Add new record" link:

protected void BackPackerListGrid_ItemDataBound(object sender, GridItemEventArgs e)
        {

            if (e.Item is GridCommandItem)
            {
                GridCommandItem cmditm = (GridCommandItem)e.Item;
                LinkButton lnkbtn1 = (LinkButton)cmditm.FindControl("InitInsertButton");
                lnkbtn1.Visible = false;

            }
        } 

however, the file icon is still there, which users can still click to add new records. I want to remove that icon as well. Please advise.

Damian

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 25 Jun 2008, 05:38 AM
Hi Damian,

Try the following code snippet to achieve the desired scenario.

CS:
 protected void RadGrid2_ItemDataBound(object sender, GridItemEventArgs e) 
    { 
        if (e.Item is GridCommandItem) 
        { 
            GridCommandItem cmditm = (GridCommandItem)e.Item; 
            LinkButton lnkbtn1 = (LinkButton)cmditm.FindControl("InitInsertButton"); 
            Button btn  = (Button)cmditm.FindControl("AddNewRecordButton"); 
            btn.Visible = false
            lnkbtn1.Visible = false
 
        } 
  } 


Thanks
Shinu.
Tags
Grid
Asked by
Damian
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or