
Hello,
I want to disable Add New Record and Refresh link which on the top of the RadGrid. Actually I have some limitations and so i can not implement ''CommandItemTemplate' to do this.
If there is any other way please guide me.
Thanks & Regards,
Hardik.
11 Answers, 1 is accepted
You can use ItemCreated to modify default command item. Here is an example:
if(e.Item is GridCommandItem)
{
LinkButton LinkButton1 = e.Item.FindControl("InitInsertButton");
LinkButton1.Enabled = false;
LinkButton LinkButton2 = e.Item.FindControl("RebindGridButton");
LinkButton2.Enabled = false;
}
All the best,
Vlad
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center

Hello,
Thanks for the reply. When I executed this code I didn’t find the control I was looking for.
Can you do me a favor, can you provide me the sample working example to disable Add New Record and Refresh controls.
Thanks & Regards,
Hardik.
You can find the example attached.
Kind regards,
Vlad
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center

Hello,
I am sorry but it is not working as it has to. I am getting error like 'Object reference not set to an instance of an object.’
If possible please provide me working error free solution.
Thanks & regards,
Hardik

Here are the details for the exception I am getting
Server Error in '/' Application.
Object reference not set to an instance of an object.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.
Source Error:
|
I'm not sure how did you get this exception? From my project or from your project?
All the best,
Vlad
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center

Yes dear, just from your code I have got that error. Can you just check the code you have sent me as a solution? I think you have send it to me without checking the code.
Kindly provide your comments,
Thanks & Regards,
Hardik
Here is a screenshot from the running version of my code.
Kind regards,
Vlad
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center

The sample that you have sent is using assemblies having version 3.5.
Actually we are using RadGrid.Net2.dll having version '4.6.2.0'. And one more thing, We are developng this application in Asp.Net 2.0. So now if you can help me by keeping these boundaries in mind, I will be very thankful….J
Thanks & Regards,
Hardik

Try setting CommandItemDisplay to None if you dont want to display AddNewRecord and Refresh button.
Shinu.

worked for me