I managed it to hides Add New Record button but only the one at the top. The other one at the bottom remains visible :(
Also how do i hide the delete button? I tried the next but it didn't work properly.
the Edit button gets hidden but the delete throws an exception "Object reference not set to an instance of an object".
| if (e.Item is GridCommandItem) |
| { |
| GridCommandItem cmdItem = (GridCommandItem)RadGrid1.MasterTableView.GetItems(GridItemType.CommandItem)[0]; |
| ((LinkButton)cmdItem.FindControl("InitInsertButton")).Visible = false; |
| } |
Also how do i hide the delete button? I tried the next but it didn't work properly.
| if (e.Item is GridDataItem) |
| { |
| GridDataItem item = (GridDataItem)e.Item; |
| LinkButton editButton = (LinkButton)item.FindControl("EditButton"); |
| editButton.Visible = false; |
| //LinkButton deleteButton = (LinkButton)item.FindControl("DeleteButton"); |
| //deleteButton.Visible = false; |
| } |
the Edit button gets hidden but the delete throws an exception "Object reference not set to an instance of an object".