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

[Solved] RadGrid Insert,Update and Delete with confirmation.

6 Answers 862 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Nagendra
Top achievements
Rank 1
Nagendra asked on 15 Nov 2011, 05:44 AM
Hi All,
     I need help in the radgrid Insert, Update and Delete functionalities with delete record confirmation using SqlConnection.
    Please provide me any sample code to resolve my scenario.


Thanks,
Nagendra.

6 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 15 Nov 2011, 06:53 AM
Hello Nagendra,

Check the following demo which implements the same.
Grid / Automatic Operations

-Shinu.
0
Pradeep
Top achievements
Rank 1
answered on 22 Nov 2012, 12:33 PM
Hi,
  I have a delete option in grid..,

<telerik:GridButtonColumn ConfirmText="Do you want to Delete this Project?"
                                        ConfirmDialogType="RadWindow" CommandName="Delete" ButtonType="ImageButton" UniqueName="Delete"
                                        HeaderText="Delete" ItemStyle-HorizontalAlign="Center">
                                    </telerik:GridButtonColumn>

I need is if i click on delete it gives the confirmation text what we hard coded...,
but in grid if i click delete on name "pradeep" it should show "Do you want to Delete "Pradeep"?

how to do that pls.., need a urgent reply...,

thanks in advance.
0
Andrey
Telerik team
answered on 27 Nov 2012, 11:11 AM
Hi,

You could achieve your goal by using the following code:

<telerik:GridButtonColumn ConfirmTextFormatString="Do you want to Delete {0}?" ConfirmTextFields="ContactName"
    ConfirmDialogType="RadWindow" CommandName="Delete" ButtonType="ImageButton" UniqueName="Delete"
    HeaderText="Delete" ItemStyle-HorizontalAlign="Center">
</telerik:GridButtonColumn>

But you will need to change the "ContactName" with the name of the DataField from which you want to take the value.

Kind regards,
Andrey
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Harish
Top achievements
Rank 1
answered on 19 Apr 2013, 01:26 PM
Hi,

I need to perform delete with confirmation.
if i use

     if(!confirm('Do you want to delete this item?')){return false;}

its working fine.

but im using a custom jquery alert which has a callback

custom_alert('warning', 'Warning', 'Do you want to delete this item?', ['Ok','Cancel'], 'customCallBack', null); return false;

function customCallBack(btn_label) {
var btnval = $('.button-label', btn_label).html();
}


btnva returns button text
how do i perform delete with this custom alert?
thanks,
0
Elliott
Top achievements
Rank 2
answered on 19 Apr 2013, 05:16 PM
Harish - Insert and Update can be done by emitting a custom script on the ItemDataBound event and looking for the Edit or Insert item
then the script can be added as an attribute to the Insert or Update buttons (maybe someone else can figure out the code)

the delete would have to navigate back through the GridItem which is attached to the link button which issued the delete command
0
Harish
Top achievements
Rank 1
answered on 22 Apr 2013, 04:32 AM
Hi,

Thanks for your reply.

Its working. I passed the row index as parameter to the custom_alert and is used fireCommand with argument
and handled it in server side.

Thanks
Tags
Grid
Asked by
Nagendra
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Pradeep
Top achievements
Rank 1
Andrey
Telerik team
Harish
Top achievements
Rank 1
Elliott
Top achievements
Rank 2
Share this question
or