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

._selectAllRows does not work in RadWindow with ContentTemplate

1 Answer 56 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Dan
Top achievements
Rank 1
Dan asked on 30 Nov 2012, 04:39 PM
I am using a RadGrid w/ GridClientSelectColumn inside a RadWindow w/ ContentTemplate.  If I place this RadGrid outside of the RadWindow - the ._selectAllRows event works as expected.  But inside the ContentTemplate - it is not finding the reference to the RadGrid - instead throwing this error:

  1. Uncaught TypeError: Cannot call method 'get_element' of null ScriptResource.axd:5723
    1. Telerik.Web.UI.RadGrid._selectAllRowsScriptResource.axd:5723
    2. onclick

This is the checkbox code that is automatically rendered in the header to allow you to select all:

<input id="wSaveOptions_C_gUnbilledOrders_ctl01_ctl09_ctl01_ClientSelectColumnSelectCheckBox" type="checkbox" name="wSaveOptions$C$gUnbilledOrders$ctl01$ctl09$ctl01$ClientSelectColumnSelectCheckBox" onclick="$find(&quot;wSaveOptions_C_gUnbilledOrders&quot;)._selectAllRows(&quot;wSaveOptions_C_gUnbilledOrders_ctl00&quot;, &quot;&quot;, event);" />

Oddly, if I write my own routine to deal with it, it works fine:

function selectAll()
{
    var masterTable = $find('<%= gUnbilledOrders.ClientID%>').get_masterTableView();
    masterTable.selectAllItems();
}
 
function clearAll()
{
    var masterTable = $find('<%= gUnbilledOrders.ClientID%>').get_masterTableView();
    masterTable.clearSelectedItems();
}

which is rendered as

function selectAll()
{
    var masterTable = $find('wSaveOptions_C_gUnbilledOrders').get_masterTableView();
    masterTable.selectAllItems();
}
 
function clearAll()
{
    var masterTable = $find('wSaveOptions_C_gUnbilledOrders').get_masterTableView();
    masterTable.clearSelectedItems();
}

Am I doing something wrong?  Can I not have a SelectColumn RadGrid in a RadWindow ContentTemplate?

Using the latest normal release Q3-2012

1 Answer, 1 is accepted

Sort by
0
Eyup
Telerik team
answered on 05 Dec 2012, 01:16 PM
Hi Dan,

I have created a sample RadGrid web site to test the described behavior. On my side everything works as expected and all of the ClientSelectColumn's checkboxes successfully select their corresponding grid items. Please check out the attached application and try to distinguish the crucial differences between our projects.

All the best,
Eyup
the Telerik team
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 their blog feed now.
Tags
Grid
Asked by
Dan
Top achievements
Rank 1
Answers by
Eyup
Telerik team
Share this question
or