Hi,
I have a grid which is similar to the following demo:
http://demos.telerik.com/aspnet-ajax/grid/examples/hierarchy/declarativerelations/defaultcs.aspx
In this grid I have Radbuttons which toggle on/off and adjust some figuress. On each toggle button I have a javascript function which calls a web service, which calls a store proc. After this I then attempt to rebind the grid on the client side like so
When I debug the project I get this error:
Specified argument was out of the range of valid values. Parameter name: ItemHierarchicalIndex
I'm also using the follow code to keep the nestedviews expanded, if I don't use it every change would cause the grid to collapse
Thanks.
I have a grid which is similar to the following demo:
http://demos.telerik.com/aspnet-ajax/grid/examples/hierarchy/declarativerelations/defaultcs.aspx
In this grid I have Radbuttons which toggle on/off and adjust some figuress. On each toggle button I have a javascript function which calls a web service, which calls a store proc. After this I then attempt to rebind the grid on the client side like so
var
masterTable = $find( result ).get_masterTableView();
masterTable.rebind();
When I debug the project I get this error:
Specified argument was out of the range of valid values. Parameter name: ItemHierarchicalIndex
I'm also using the follow code to keep the nestedviews expanded, if I don't use it every change would cause the grid to collapse
void rg_ItemDataBound(object sender, GridItemEventArgs e)
{
//Expand all items using our custom storage
string[] indexes =
new
string[
this
.ExpandedStates.Keys.Count];
this
.ExpandedStates.Keys.CopyTo(indexes, 0);
ArrayList arr =
new
ArrayList(indexes);
//Sort so we can guarantee that a parent item is expanded before any of
//its children
arr.Sort();
foreach (string key
in
arr)
{
bool value = (bool)
this
.ExpandedStates[key];
if
(value)
{
rg.Items[key].Expanded =
true
;
}
}
}
void rg_ItemCommand(object sender, GridCommandEventArgs e)
{
//if (e.CommandName == RadGrid.ExpandCollapseCommandName && !e.Item.Expanded)
//{
if
(e.CommandName == RadGrid.ExpandCollapseCommandName)
{
this
.ExpandedStates[e.Item.ItemIndexHierarchical] =
true
;
}
}
private Hashtable _ordersExpandedState;
private Hashtable ExpandedStates
{
get
{
if
(
this
._ordersExpandedState ==
null
)
{
_ordersExpandedState =
this
.Session[
"_ordersExpandedState"
] as Hashtable;
if
(_ordersExpandedState ==
null
)
{
_ordersExpandedState =
new
Hashtable();
this
.Session[
"_ordersExpandedState"
] = _ordersExpandedState;
}
}
return
this
._ordersExpandedState;
}
}
Thanks.