I have telerik:RadGridView
I want
1) User can not delete record
2) I want a message when they delete record confirmation message
3) User can not insert new record
I am using keyboard Insert and delete key for that
Shakti
7 Answers, 1 is accepted
Now only want to know about confirmation message before delete
Setting CanUserDeleteRows to false will disable item removal altogether. If you would like to be able to delete rows only after the pending delete operation has been confirmed you should use our Deleting event. This event will fire just before any items are deleted. You can show the confirmation window when the Deleting event is fired and cancel it, which will cancel the pending delete operation, by setting e.Cancel = true.
Hope this helps.
Sincerely yours,
Milan
the Telerik team
How can I perform the same but with an Async call in RadGridView_Deleting event ?
Examples:
1 - I need to check in database if some condition is valid before allowing the user to save.
2 - Or, I need to open a ChildWindow and Wait for it to be closed before feeding the "e.Cancel" with a value.
Currently I'm using some kind of trick but I really don't like it.
The trick is that :
e.Cancel is allways True in RadGridView_Deleting. After that the async operation is called (opening of the ChildWindow, RIA call, etc...) and in it's Closed/Loaded/Done. event I perform the delete (or not) myself based on Async Return.
Yet, as I've said, I really hate this way...
There is Any COOL "Telerik's Way" to perform this kind of tasks ?
Thanks
What is going wrong? Any idea someone?
Regards
Neils
This thread is actually quite old, that is why it would be better to open a new thread sending us a demo project showing the problem you have met.
Didie
the Telerik team
Time to cast your vote for Telerik! Tell DevPro Connections and Windows IT Pro why Telerik is your choice. Telerik is nominated in a total of 25 categories.
Regards,
Joao
Please use this code instead and let me know about the result:
var deleteCommand = RadGridViewCommands.Delete
as
RoutedUICommand;
deleteCommand.Execute(
null
,
this
.grdAppt);
Greetings,
Didie
the Telerik team
Time to cast your vote for Telerik! Tell DevPro Connections and Windows IT Pro why Telerik is your choice. Telerik is nominated in a total of 25 categories.