Disable Control-Buttons of RadGridView

Using Telerik’s RadGridView, one can connect the add, update, cancel and delete command to RadButtons by setting the

Command="telerik:RadGridViewCommands...."

properties of the buttons and link to the grid by setting the

CommandTarget="{Binding ElementName=GridViewName}"

property.

For some reasons, I needed to disable the buttons, depending on the rights the currently logged in user has. Setting

button.IsEnabled = false;

during runtime did not work, for whatever reasons. But setting

button.CommandTarget=null;

during runtime, without disabling the button, worked fine. Resetting the button’s CommandTarget to the associated RadGridView re-enabled the button.

I tend to call this a bug. Luckily, there is an easy work around.

Leave a Comment

Please note that every comment requires the admin's approval before it will be published.

Any comment containing spam like "... great topic. Feel free to visit my web page ..." will be deleted. So please do not waste your and our time by leaving such comments.

We respect your privacy. When you leave a comment, your IP address will not be recorded by WordPress.