I have referenced the following code for saving grid settings for users
http://www.telerik.com/help/aspnet-ajax/grid-saving-settings-on-per-user-basis.html
All works well. However, when saving the object for grouping settings your page above suggests the following code:
In the while statement the i variable is used for both the GroupByExpressionsStates index and the GroupByExpressions index.
If only one GroupBy expression is selected by the user, then the GroupByExpressions.Count = 1 and the the object length = 2.
When going through the loop, it fails because once past the first index of 0, there is no group expression for Grid.MasterTableView.GroupByExpressions(1).
I'm trying to figure out why the empty object created by the statement:
Settings.GroupByExpressionsStates = New Object(Grid.MasterTableView.GroupByExpressions.Count) {}
is creating a Settings.GroupByExpressionsStates object with 2 empty arrays when only 1 is needed for this example?
Please see the attachments.
http://www.telerik.com/help/aspnet-ajax/grid-saving-settings-on-per-user-basis.html
All works well. However, when saving the object for grouping settings your page above suggests the following code:
Protected
Overridable
Sub
SaveGroupByExpressions()
Settings.GroupByExpressionsStates =
New
Object
(Grid.MasterTableView.GroupByExpressions.Count) {}
Dim
i
As
Integer
= 0
While
i < Settings.GroupByExpressionsStates.Length
Settings.GroupByExpressionsStates(i) =(
DirectCast
(Grid.MasterTableView.GroupByExpressions(i),IStateManager)).SaveViewState() System.Math.Max(System.Threading.Interlocked.Increment(i), i - 1)
End
While
End
Sub
In the while statement the i variable is used for both the GroupByExpressionsStates index and the GroupByExpressions index.
If only one GroupBy expression is selected by the user, then the GroupByExpressions.Count = 1 and the the object length = 2.
When going through the loop, it fails because once past the first index of 0, there is no group expression for Grid.MasterTableView.GroupByExpressions(1).
I'm trying to figure out why the empty object created by the statement:
Settings.GroupByExpressionsStates = New Object(Grid.MasterTableView.GroupByExpressions.Count) {}
is creating a Settings.GroupByExpressionsStates object with 2 empty arrays when only 1 is needed for this example?
Please see the attachments.