Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6781439
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T16:37:27+00:00 2026-05-26T16:37:27+00:00

I have a class that defines a Hierarchical RadGrid that I will be using

  • 0

I have a class that defines a Hierarchical RadGrid that I will be using application wide. This grid has many column so this is the best implementation for me, as I will be overriding specific characteristics of the grid based om implementation.

The grid will function in a different manner based on the access level of the user. On a ‘basic user level’ they will have a Add New Item/Edit Item on the parent grid and Edit, Reject(delete), Approve(Update) on the Child Grid

The next level will be a ‘Approver’ role. They will NOT have Add New Item/Edit Item on the parent grid and will only have Reject(Edit) on the child. The edit action that the user will take in this role when rejecting an item is that they will be required to enter a comment through a user control that will be launched when the click the reject button. The problem that I am having is that the custom user control is not displaying for a DetailTableView.EditFormSettings when using a GridButtonColumn as the firing event. Any thoughts? TIA

private void SubmittedBatchesRadGrid_ItemDataBound(object sender, GridItemEventArgs e)
{
    GridDataItem _dataItem = e.Item as GridDataItem;
    if (_dataItem == null) return;

    if (e.Item.OwnerTableView.Name == "SubmittedBatchesRadGrid_ChildGrid")
    {
        SetChildGridCommandColumns(sender, e);
        return;
    }

    if (_dataItem.KeyValues == "{}") { return; }

    SetMasterGridCommandColumns(sender, e, _dataItem);

}

private static void SetChildGridCommandColumns(object sender, GridItemEventArgs e)
{
    const string _jqueryCode = "if(!$find('{0}').confirm('{1}', event, '{2}'))return false;";
    const string _confirmText = "<p>Rejecting this adjustment will mean that you will have to also reject the batch when you are done processing these items.</p><p>Are you sure you want to reject this adjustment?</p>";
    ((ImageButton)(((GridEditableItem)e.Item)["PolicyEditRecord"].Controls[0])).ImageUrl = "/controls/styles/images/editpencil.png";
    ImageButton _btnReject = (ImageButton)((GridDataItem)e.Item)["DeleteTransaction"].Controls[0];

    _btnReject.CommandName = "Update";
    _btnReject.ImageUrl = "/controls/styles/images/decline.png";
    _btnReject.ToolTip = "Reject this item";
    //_btnReject.Attributes["onclick"] = string.Format(_jqueryCode, ((Control)sender).ClientID, _confirmText, "Reject Adjustment");
}

private void SubmittedBatchesRadGrid_DetailTableDataBind(object sender, GridDetailTableDataBindEventArgs e)
{
    e.DetailTableView.EditFormSettings.EditFormType = GridEditFormType.WebUserControl;
    e.DetailTableView.EditFormSettings.UserControlName = "/Controls/RejectedAdjustmentComment.ascx";
    e.DetailTableView.EditMode = GridEditMode.PopUp;

    e.DetailTableView.CommandItemSettings.ShowAddNewRecordButton = false;
    GridDataItem _dataItem = e.DetailTableView.ParentItem;
    e.DetailTableView.DataSource = AdjustmentAPI.GetAdjustmentsByBatch(Convert.ToInt32(_dataItem.GetDataKeyValue("BatchID").ToString()), PolicyClaimManualAdjustmentCode);
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T16:37:27+00:00Added an answer on May 26, 2026 at 4:37 pm

    So I thought I would share my solution in case anyone else needs it.

    I was barking up the wrong tree with the edit control. Even though a comment is part of the dataset in the RadGrid I don’t want to edit the existing record. I decided to create a usercontrol to handle the process. The RadWindow does not take .ascx pages directly so I started with a .aspx wrapper page and inserted the control there. Then I changed the OnClientClick event to launch the RadWindow loading the new aspx file passing the parameters I needed to the usercontrol. The usercontrol saves the comment to the database and updates the record status and then closes.

    I modified this section from above:

        private static void SetChildGridCommandColumns(object sender, GridItemEventArgs e)
        {
            ((ImageButton)(((GridEditableItem)e.Item)["PolicyEditRecord"].Controls[0])).ImageUrl = "/controls/styles/images/editpencil.png";
            ImageButton _btnReject = (ImageButton)((GridDataItem)e.Item)["DeleteTransaction"].Controls[0];
            int _manualAdjustmentId = Convert.ToInt32(((GridDataItem)e.Item)["ManualAdjustmentId"].Text);
            int _manualAdjustmentBatchId = Convert.ToInt32(((GridDataItem)e.Item)["ManualAdjustmentBatchId"].Text);
    
            _btnReject.ImageUrl = "/controls/styles/images/decline.png";
            _btnReject.ToolTip = "Reject this item";
            _btnReject.OnClientClick = String.Format("OpenRadWindow('/controls/RejectedAdjustmentComment.aspx?manualAdjustmentId={0}&manualAdjustmentBatchId={1}', 'CommentDialog');return false;", _manualAdjustmentId, _manualAdjustmentBatchId);
        }
    
        private void SubmittedBatchesRadGrid_DetailTableDataBind(object sender, GridDetailTableDataBindEventArgs e)
        {
    //I deleted this section
            e.DetailTableView.EditFormSettings.EditFormType = GridEditFormType.WebUserControl;
            e.DetailTableView.EditFormSettings.UserControlName = "/Controls/RejectedAdjustmentComment.ascx";
            e.DetailTableView.EditMode = GridEditMode.PopUp;
    //
    
            e.DetailTableView.CommandItemSettings.ShowAddNewRecordButton = false;
            GridDataItem _dataItem = e.DetailTableView.ParentItem;
            e.DetailTableView.DataSource = AdjustmentAPI.GetAdjustmentsByBatch(Convert.ToInt32(_dataItem.GetDataKeyValue("BatchID").ToString()), PolicyClaimManualAdjustmentCode);
        }
    

    I added this to the page with the datagrid:

    <telerik:RadWindowManager ID="SubmittedBatchesWindow" runat="server">
        <windows>
                <telerik:RadWindow ID="CommentDialog" runat="server" Title="Rejected Agjustment Comment Dialog"
                    Height="350px" Width="440" Left="250px" ReloadOnShow="false" ShowContentDuringLoad="false"
                    Modal="true" VisibleStatusbar="false" />
            </windows>
    </telerik:RadWindowManager>
    

    I created a new aspx file and inserted the new ascx control inside

    <form id="form1" runat="server">
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
    </telerik:RadScriptManager>
    <uc:RejectedComment id="RejectionComment1" runat="server" />
    </form>
    

    I added my code behind for the update in the ascx file, the javascript for the front end

    <script language ="javascript" type ="text/javascript" >   
        //<![CDATA[
        function GetRadWindow() {
            var oWindow = null;
            if (window.radWindow) oWindow = window.radWindow; //Will work in Moz in all cases, including clasic dialog
            else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow; //IE (and Moz as well)
    
            return oWindow;
        }
    
        function CancelEdit() {
            GetRadWindow().close();
        }
    
        //]]>
    </script>  
    

    and last but not least closing the window after a successful update in the button click event;

    Page.ClientScript.RegisterStartupScript(Page.GetType(), "", "CancelEdit();", true);
    

    I hope someone else finds this useful. It took me several hours hunting the telerik site to find this piece by piece.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So I have a base class that has many children. This base class defines
I have an abstract class that defines some methods. This class has two subclasses.
I have a class that defines its own enum like this: public class Test
If I have a parent-child that defines some method .foo() like this: class Parent
I have a class that defines the names of various session attributes, e.g. class
I have a class that defines a CallRate type. I need to add the
I have a class that defines a read-only property that effectively exposes a private
I have a Literal class that defines a text value and an ID. I
I have an actionscript file that defines a class that I would like to
I have an AbstractEntity class as superclass for all my entites that defines an

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.