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

[Solved] How to remove Refresh from CommandItemDisplay

4 Answers 226 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Bob
Top achievements
Rank 1
Bob asked on 18 Mar 2008, 05:29 PM
I am using a prometheus radGrid.  I have the Add New Record and refresh links at the top since I have this property set like:

CommandItemDisplay

="Top"

My question is, how do I remove the Refresh link?  I just want the Add New Record to appear.

Thanks,
Bob

4 Answers, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 19 Mar 2008, 07:09 AM
Hello Bob,

The easiest way is to define your own CommandItemTemplate with desired buttons. Other possible solution is to handle ItemCreated and set Visible = false for the Refresh button. Here is an example:

if(e.Item is GridCommandItem)
{
   LinkButton LinkButton1 = e.Item.FindControl("RefreshButton");
   LinkButton1.Visible = false;
}

All the best,
Vlad
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Bob
Top achievements
Rank 1
answered on 19 Mar 2008, 04:16 PM
Vlad,

This did not work.  I use VB.Net so maybe I did something wrong when I converted your C# example to VB.Net.  Here is my code:

If

TypeOf e.Item Is GridCommandItem Then

Dim LinkButton1 As LinkButton = e.Item.FindControl("RefreshButton")

LinkButton1.Visible = False

End If

Anything else I can try?

Thanks,
Bob

0
Vlad
Telerik team
answered on 19 Mar 2008, 04:22 PM
Hi Bob,

Sorry for the wrong code - it seems that the ID for this button is "RebindGridButton".

Sincerely yours,
Vlad
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Bob
Top achievements
Rank 1
answered on 19 Mar 2008, 04:29 PM
Thanks Vlad, that worked.
Tags
Grid
Asked by
Bob
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Bob
Top achievements
Rank 1
Share this question
or