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

Fire click event or command of LinkButton from inside radgrid

1 Answer 59 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Covertix
Top achievements
Rank 1
Covertix asked on 17 Dec 2013, 01:23 PM
Hi,

I have a grid with a link button:

<telerik:GridButtonColumn HeaderStyle-Width="80px" ItemStyle-Width="80px" ButtonType="LinkButton" UniqueName="Block" />

on ItemDataBound I add onclientclick event that opens a confirmation window:

    function UserBlock() {
        $.confirm({
            'title': 'Covertix',
            'message': 'Are you sure you want to block this user?',
            'icon': '../Images/Icons/System/garbage.png',
            'container': '#MainBoxFull',
            'buttons': {
                'No': {
                    'class': 'CovertixButtonForMsgBox',
                    'action': function() {
                        $.confirm.hide();
                    }
                },

                'Yes': {
                    'class': 'CovertixButtonForMsgBox',
                    'action': function() {
                        $.confirm.hide();
                    }
                }
            }
        });

        return false;
    }


Inside the 'Yes' callback, I want to fire a click event or block command.
Is it possible?
I tried in many ways without success.

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 18 Dec 2013, 07:40 AM
Hi,

Please try the following JavaScript Code which works fine at my end.

JavaScript:
<script type="text/javascript">
    function UserBlock(e) {
        if (confirm('Are you sure you want to block this user?')) {
            alert('Yes');
            Check();
        }
        else {
            alert('No!');
        }
    }
    function Check(sender, args) {
        alert("Fired");
    }
</script>

Thanks,
Shinu.
Tags
Grid
Asked by
Covertix
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or