I have created a javascript in my aspx. But I always get 'Rows.length' is null or not an object error message. Please help me. Below is my javascript:
<script type="text/javascript" language="javascript">
var grid;
var i;
function GridCreated()
{
grid = this;
}
function HierarchyExpanding(sender, args)
{
PerformAction(grid.MasterTableView)
if (i != 1000)
{
if(!confirm("Are you sure you want to expand without update?"))
{
args.set_cancel(true);
}
else
{
$find("<%= RadGrid1.MasterTableView.ClientID %>").collapseItem(i);
}
)
}
function PerformAction(tableview)
{
i = 1000;
for (var j=0; j < tableview.Rows.length; j++)
{
if ($find("<%= RadGrid1.MasterTableView.ClientID %>").get_dataItems()[j].get_expanded())
{
i=j;
}
}
}
</script>
And this is my radgrid:
<telerik:RadGrid ID="RadGrid1" Skin="Default" runat="server" ShowStatusBar="true"
Width="95%" AutoGenerateColumns="False" PageSize="5" AllowSorting="True" AllowMultiRowSelection="True"
AllowPaging="True" GridLines="None" AllowAutomaticDeletes="True" AllowAutomaticInserts="True" AllowAutomaticUpdates="True">
<PagerStyle Mode="NumericPages" />
<ClientSettings>
<Selecting AllowRowSelect="true" />
<ClientEvents OnGridCreated="GridCreated" OnHierarchyExpanding="HierarchyExpanding" />
</ClientSettings>
<MasterTableView Width="100%" HierarchyLoadMode="Client" .....
Thanks in advance.