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

telerik:RadGridView delete and delete Message

7 Answers 108 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Shakti SIngh Dulawat
Top achievements
Rank 1
Shakti SIngh Dulawat asked on 17 Nov 2010, 08:47 PM
Hello friend
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

Sort by
0
Shakti SIngh Dulawat
Top achievements
Rank 1
answered on 17 Nov 2010, 08:50 PM
I got two answer CanUserDeleteRows="False" CanUserInsertRows="False"
Now only want to know about confirmation message before delete
0
Milan
Telerik team
answered on 17 Nov 2010, 08:59 PM
Hi Shakti SIngh Dulawat,

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
Browse the videos here>> to help you get started with RadControls for Silverlight
0
joao rodrigues
Top achievements
Rank 1
answered on 09 Nov 2011, 08:11 PM
Hi Milan,

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
0
Heiko
Top achievements
Rank 1
answered on 28 Sep 2012, 02:03 PM
I have a similar issue here when I try to use RadWindow.Confirm(...) In Grd_Deleting event I set e.Cancel = true, then call RadWindow.Confirm(...) and finally in the Closed callback I call RadGridViewCommands.Delete.Execute(this.grdAppt.SelectedItems); Nothing happens.
What is going wrong? Any idea someone?

Regards
Neils
0
Dimitrina
Telerik team
answered on 29 Sep 2012, 10:42 AM
Hello 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.

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.

0
joao rodrigues
Top achievements
Rank 1
answered on 29 Sep 2012, 01:12 PM
This thread is old indeed, yet, my question remains unanswered.

Regards,
Joao
0
Dimitrina
Telerik team
answered on 29 Sep 2012, 01:44 PM
Hi Neils,

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.

Tags
GridView
Asked by
Shakti SIngh Dulawat
Top achievements
Rank 1
Answers by
Shakti SIngh Dulawat
Top achievements
Rank 1
Milan
Telerik team
joao rodrigues
Top achievements
Rank 1
Heiko
Top achievements
Rank 1
Dimitrina
Telerik team
Share this question
or