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

calling findControl in OnGridCreated event handler returns null

1 Answer 86 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Joe Kalinowski
Top achievements
Rank 1
Joe Kalinowski asked on 27 Jul 2011, 06:32 PM

 

 

The findControl method is not able to find controls when called inside of the event handler for the OnGridCreated event as follows. This will cause an error because findControl() returns null. Shouldn't the controls be loaded at this point? Note that I am able to find controls in the row selected/deselected event handlers.

 

function gridCreated(sender, args)
{
    for (var i = 0; i <= sender.get_selectedItems().length - 1; i++)
    {
        sender.get_selectedItems()[i].findControl("rntbMinDistance").enable();
    }
}

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 28 Jul 2011, 07:53 AM
Hello Joe,

Please make sure that the selected row is getting correctly. Here is the code which I tried that worked as expected.

Javascript:
function gridCreated(sender, args)
{
   . . . . .
 sender.get_selectedItems()[i].findControl("rntbMinDistance").enable();
}

Thanks,
Princy
Tags
Grid
Asked by
Joe Kalinowski
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Share this question
or