Grid: ask for confirmation on select all

2 posts, 0 answers
  1. kiwo
    kiwo avatar
    17 posts
    Member since:
    Apr 2007

    Posted 30 Jul 2009 Link to this post


    I have a GridClientSelectColumn in my grid. The feature I need is the following:
    When SELECT ALL checkbox is checked or unchecked, before it performs the action, confirmation message is required, depending on the status:
    "Are you sure you want to ...(select/deselect all entries)"

    How do I accomplish that?
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 30 Jul 2009 Link to this post


    Try the following code snippet in order to show confirm on checking/unchecking the header checkbox of GridClientSelectColumn.

    <telerik:GridClientSelectColumn UniqueName="Selectcolumn" Text="Select" HeaderText="Select"

    protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e) 
        if (e.Item is GridHeaderItem) 
            GridHeaderItem item = (GridHeaderItem)e.Item; 
            CheckBox chkbx = (CheckBox)item["Selectcolumn"].Controls[0]; 

    <script type="text/javascript"
    function showConfirm(chk) 
        var c = document.getElementById(chk); 
        var grid = $find("<%=RadGrid1.ClientID %>"); 
        if(confirm('Do you want to select/unselect all ...?')) 
            c.checked= !c.checked; 
    Happy coding.. :)

Back to Top