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

Can't get RadGrid ClientID from grid opened in RadWindowManager

1 Answer 24 Views
This is a migrated thread and some comments may be shown as answers.
Top achievements
Rank 1
Bruce asked on 18 Sep 2013, 08:09 PM
I have an page with a RadGrid that displays insurance agents. The page opens a web user control for editing the insurance agent. That control also has a button that uses the RadWindowManager to show another page as a dialog that contains a RadGrid that displays insurance companies. When the insurance companies window is closed I need to add the selected insurance companies to the insurance agent being edited. The RadWindowManager seems to do something to interfere with the insurance company RadGrid's ClientID because the script returns just the ID entered at design time. I have also tried using the Page_PreRender event to add the script, but the ClientID is still wrong. I am willing to change how I am doing this if there is a better way.

The .aspx page RadWindowManager code:
<telerik:RadWindowManager ID="RadWindowManager1" runat="server">
        <telerik:RadWindow ID="RadWindow1" runat="server"
            Title="Add Insurance Companies"
            Behaviors="Move, Close">
... other page code
<button type="button" class="btn" onclick="addInsuranceCompany()">Add</button>
... still more code
<script type="text/javascript">
    function addInsuranceCompany() {
        radopen("InsuranceCustomerSelection.aspx", "RadWindow1");
    function onInsuranceCompanyListClose(oWnd, args) {
        alert(args.length + ' args');

1 Answer, 1 is accepted

Sort by
Konstantin Dikov
Telerik team
answered on 23 Sep 2013, 03:35 PM
Hi Bruce,

The ClientID given by ASP.NET when ClientIDMode is set to "AutoID" is generated by concatenating the ID values of each parent naming container with the ID value of the control. When you open a new page with RadGrid in RadWindow, the RadGrid will have clear ClientID (the one that is set in the markup). This behavior is not observable when you are using UserControls.

For your scenario I could suggest you use the PopUp Edit Form with "EditFormType" set to "WebUserControl" and use two UserControls instead of one UserControl and a page.

If you continue to face that issue with your project, please open a regular support ticket and try to prepare a sample, runnable project that so we could inspect it further locally.


Konstantin Dikov
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 the blog feed now.
Asked by
Top achievements
Rank 1
Answers by
Konstantin Dikov
Telerik team
Share this question