Rad Windows Manager

4 posts, 2 answers
  1. Swapnil
    Swapnil avatar
    96 posts
    Member since:
    Aug 2013

    Posted 09 Oct 2013 Link to this post

    HI,
     i am having grid with edit mode(update ,delete , automatic insert) and i want a validation using rad window that sure to delete if client select yes then record will be deleted otherwise not,
    and after thar success msg apper on insert data

    Thanks
  2. Answer
    Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 09 Oct 2013 Link to this post

    Hi Swapnil,

    If you are using a GridButtonColumn for Delete operation,please try the following code snippet.

    ASPX:
    <telerik:GridButtonColumn ConfirmText="Delete this product?" ConfirmDialogType="RadWindow"                       ConfirmTitle="Delete" ButtonType="ImageButton" CommandName="Delete" Text="Delete"                        UniqueName="DeleteColumn">
    </telerik:GridButtonColumn>

    In case if you are using AutoGenerateDeleteColumn,please try the following code snippet.

    C#:
    protected void RadGrid1_ItemCreated(object sender, GridItemEventArgs e)
        {
            if (e.Item is GridDataItem)
            {
                GridDataItem item = (GridDataItem)e.Item;
                LinkButton lnkBtnDelete = (LinkButton)item["AutoGeneratedDeleteColumn"].Controls[0];
                lnkBtnDelete.Attributes["onclick"] = "javascript:return confirm(\'Do you want to delete this item?\')";
            }
        }

    Thanks,
    Princy


  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Swapnil
    Swapnil avatar
    96 posts
    Member since:
    Aug 2013

    Posted 09 Oct 2013 Link to this post

    After deletion How can i show that record deleted successfully?
    and i also want to show the success msg for data insertion

    THANKS
  5. Answer
    Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 09 Oct 2013 Link to this post

    Hi Swapnil,

    I guess you are using Automatic CRUD operation.Please try the following code snippet to open confirm window for you operations.

    ASPX:
    <telerik:RadAjaxManager ID="RadAjaxManager1" EnableAJAX="true" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="RadGrid1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadGrid1" LoadingPanelID="RadAjaxLoadingPanel1">
                    </telerik:AjaxUpdatedControl>           
                    <telerik:AjaxUpdatedControl ControlID="RadWindowManager1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
    <telerik:RadWindowManager ID="RadWindowManager1" runat="server">
    </telerik:RadWindowManager>

    C#:
    protected void RadGrid1_ItemInserted(object source, GridInsertedEventArgs e)
       {
           if (e.Exception != null)
           {
               e.ExceptionHandled = true;       
               RadWindowManager1.RadConfirm("New product is not inserted", null, 300, 200, null, "Insert");
           }
           else
           {        
               RadWindowManager1.RadConfirm("Successfully New product is inserted", null, 300, 200, null, "Insert");
           }
       }
    protected void RadGrid1_ItemDeleted(object source, GridDeletedEventArgs e)
       {
           GridDataItem dataItem = (GridDataItem)e.Item;
           String id = dataItem.GetDataKeyValue("ProductID").ToString();
           if (e.Exception != null)
           {
               e.ExceptionHandled = true;
               SetMessage("Product with ID " + id + " cannot be deleted. Reason: " + e.Exception.Message);
           }
           else
           {         
               RadWindowManager1.RadConfirm("Product with ID " + id + " is deleted!", null, 300, 200, null, "Delete");
           }
       }

    Thanks,
    Princy
Back to Top