10 Answers, 1 is accepted
0
Hello Bob,
I have attached small example to illustrate you how to achieve this.
Kind regards,
Vlad
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
I have attached small example to illustrate you how to achieve this.
Kind regards,
Vlad
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
0
Bob
Top achievements
Rank 1
answered on 22 Apr 2008, 05:00 PM
I looked at your code and the only difference was you set the property to TRUE. I tried that and still in the left hand corner I still have the icon to insert a new row. When I click on it it tries to insert a row but when save because my data source does not have an insert command I get an error. I do not want for this page any user trying to insert a row...only update existiung rows.
I want to attach a pix of the grid so you understand what I am talking about...but I see no easy way. Anyway I hope you can understand my data source only has an Udate command no Ddelete or Insert but still I see the icon at the top of the grid that allows insert.
I want to attach a pix of the grid so you understand what I am talking about...but I see no easy way. Anyway I hope you can understand my data source only has an Udate command no Ddelete or Insert but still I see the icon at the top of the grid that allows insert.
0
Hi Bob,
You need to set the RadGrid MasterTableView CommandItemDisplay property to None if you don't want the insert button on the top left to be visible. Give this suggestion a try and let us know if the problem persists.
All the best,
Iana
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
You need to set the RadGrid MasterTableView CommandItemDisplay property to None if you don't want the insert button on the top left to be visible. Give this suggestion a try and let us know if the problem persists.
All the best,
Iana
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
0
Bob
Top achievements
Rank 1
answered on 23 Apr 2008, 11:39 AM
Yes that solved the problem. I was hoping I could retain the refresh and not the the Insert.
Thanks.
Thanks.
0
Shinu
Top achievements
Rank 2
answered on 23 Apr 2008, 12:37 PM
Hi Bob,
You can try the following code snippet to hide the AddNewRecord button.
CS:
Hope this helps..
Shinu.
You can try the following code snippet to hide the AddNewRecord button.
CS:
protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e) |
{ |
if (e.Item is GridCommandItem) |
{ |
GridCommandItem cmditm = (GridCommandItem)e.Item; |
LinkButton lnkbtn1 = (LinkButton)cmditm.FindControl("InitInsertButton"); |
lnkbtn1.Visible = false; |
} |
} |
Hope this helps..
Shinu.
0
bill
Top achievements
Rank 1
answered on 11 Jul 2008, 06:44 PM
This removed the text part of the button but the image is still there and can be clicked.
0
Princy
Top achievements
Rank 2
answered on 14 Jul 2008, 06:00 AM
Hello Bill,
You can try out the following code to remove/hide the CommandItem image as well as text.
CS:
Regards
Princy.
You can try out the following code to remove/hide the CommandItem image as well as text.
CS:
protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e) |
{ |
if (e.Item is GridCommandItem) |
{ |
GridCommandItem cmditm = (GridCommandItem)e.Item; |
Button btn1 = (Button)cmditm.FindControl("AddNewRecordButton"); |
btn1.Visible = false; |
LinkButton lnkbtn1 = (LinkButton)cmditm.FindControl("InitInsertButton"); |
lnkbtn1.Visible = false; |
} |
} |
Regards
Princy.
0
Rybovich IT Department
Top achievements
Rank 1
answered on 14 Jan 2009, 08:48 PM
Could you convert this code to VB for me? We took a stab at it but couldn't get it.
0
Princy
Top achievements
Rank 2
answered on 15 Jan 2009, 04:13 AM
Hello John,
Below given is the VB code to hide the AddNewRecord button and image from the command item:
VB:
You can also use the following Conversion Tool to convert from C# to VB and vice versa.
Convert C# to VB.NET
Thanks
Princy.
Below given is the VB code to hide the AddNewRecord button and image from the command item:
VB:
Protected Sub RadGrid1_ItemDataBound(ByVal sender As Object, ByVal e As GridItemEventArgs) |
If TypeOf e.Item Is GridCommandItem Then |
Dim cmditm As GridCommandItem = DirectCast(e.Item, GridCommandItem) |
Dim btn1 As Button = DirectCast(cmditm.FindControl("AddNewRecordButton"), Button) |
btn1.Visible = False |
Dim lnkbtn1 As LinkButton = DirectCast(cmditm.FindControl("InitInsertButton"), LinkButton) |
lnkbtn1.Visible = False |
End If |
End Sub |
You can also use the following Conversion Tool to convert from C# to VB and vice versa.
Convert C# to VB.NET
Thanks
Princy.
0
Rybovich IT Department
Top achievements
Rank 1
answered on 15 Jan 2009, 01:21 PM
Princy,
That worked. Thanks for the help!
That worked. Thanks for the help!