Telerik Forums
UI for ASP.NET AJAX Forum
6 answers
656 views
Hi Telerik team,

I'm using Radgrid to build a tree structure with source of objects with parent and child relationship, 
and the configuration of the grid as below:

MasterTableView.HierarchyLoadMode = GridChildLoadMode.Client;
MasterTableView.HierarchyDefaultExpanded = false;
MasterTableView.SelfHierarchySettings.KeyName = "xxx";
MasterTableView.SelfHierarchySettings.ParentKeyName = "yyy";
 
ClientSettings.AllowExpandCollapse = true;
ClientSettings.AllowColumnsReorder = false;
ClientSettings.ReorderColumnsOnClient = true;

Everything works fine until when one of the node is expanded to more that 1 level, and refresh the page (based on some criteria so that the data source now has changed), the following error appears:

Specified argument was out of the range of valid values. Parameter name: ItemHierarchicalIndex

Some additional info on the error:

Source Telerik.Web.UI
Function Telerik.Web.UI.GridDataItem get_Item(System.String)
Stack Telerik.Web.UI.GridDataItemCollection.get_Item(String hierarchicalIndex)
Telerik.Web.UI.RadGrid.LoadClientState(Dictionary`2 clientState) 
System.Web.UI.Page.ProcessPostData(NameValueCollection postData, Boolean fBeforeLoad)
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)


myGrid_ClientState {"selectedIndexes":[],"reorderedColumns":[],"expandedItems":["1","1","0","0","1","1","0","0","1","1","0","0","0:0_10","0"],"expandedGroupItems":[],"expandedFilterItems":[],"deletedItems":[],"hidedColumns":[],"showedColumns":[],"popUpLocations":{},"draggedItemsIndexes":[]}


Apparently the problem is on client state data "expandedItems", i guess it is trying to restore the expanded items on the new data source (which has been changed and the expanded levels in client data may not be valid anymore).

I'm not quite sure about my observation, but i've tried to override the LoadClientState function in my custom grid:

protected override bool LoadClientState(Dictionary<string, object> clientState)
        {
            if (clientState.ContainsKey("expandedItems"))
                clientState["expandedItems"] = new object[] { };
            return base.LoadClientState(clientState);
        }

It does the trick and the page is successfully refreshed no matter how many level of nodes i expanded before.
However i would like to know is there any better solution for this, and why does this happen?

Thanks.





John
Top achievements
Rank 1
 answered on 07 Apr 2015
4 answers
135 views
Hi,

I'm working on a project which uses the RadGrid from the classic controls.

Basically, the scenario is this. When the user clicks on an edit button for a row of the RadGrid, the panel which contains the RadGird is made invisible, and another panel with an assortment of textboxes and comboboxes is made visible with details of that grid row item populating thos controls. There is also a delete button on that panel, which delete that item in the database when clicked.

The problem arises when the grid is reloaded after that delete. Following the delete button being clicked, the grid's panel is made visible again and the grid is rebound. If I then click on one of the edit buttons for a row in the grid, the following error is thrown:

Server Error in '/' Application.
--------------------------------------------------------------------------------

Specified argument was out of the range of valid values.
Parameter name: ItemHierarchicalIndex
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values.
Parameter name: ItemHierarchicalIndex

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.  

Stack Trace:


[ArgumentOutOfRangeException: Specified argument was out of the range of valid values.
Parameter name: ItemHierarchicalIndex]
   Telerik.WebControls.GridItemCollection.get_Item(String hierarchicalIndex) +103
   Telerik.WebControls.GridDataItemCollection.get_Item(String hierarchicalIndex) +37
   Telerik.WebControls.RadGrid.get_EditItems() +215
   Telerik.WebControls.RadGrid.SaveEditIndexState(String newValue) +95
   Telerik.WebControls.GridItem.set_Edit(Boolean value) +82
   Telerik.WebControls.GridCommandEventArgs.ExecuteCommand(Object source) +236
   Telerik.WebControls.RadGrid.OnBubbleEvent(Object source, EventArgs e) +191
   System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +37
   Telerik.WebControls.GridItem.OnBubbleEvent(Object source, EventArgs e) +165
   System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +37
   System.Web.UI.WebControls.ImageButton.OnCommand(CommandEventArgs e) +111
   System.Web.UI.WebControls.ImageButton.RaisePostBackEvent(String eventArgument) +176
   System.Web.UI.WebControls.ImageButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10
   System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
   System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +36
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1565
 
Any help would be appreciated. Previous searches of this forum show others have had the same problem and not resolved it.

Cheers
John
Top achievements
Rank 1
 answered on 07 Apr 2015
1 answer
85 views

I use radajax to my page. When button click everything working fine. But when enter key press raise follwing error

 

Unhandled exception at line 19979, column 1 in http://localhost:39853/Telerik.Web.UI.WebResource.axd?_TSM_HiddenField_=RadScriptManager1_TSM&compress=1&_TSM_CombinedScripts_=;;System.Web.Extensions,+Version=4.0.0.0,+Culture=neutral,+PublicKeyToken=31bf3856ad364e35:en-US:4ae4914f-8c8e-4123-9d05-414d87b48357:ea597d4b:b25378d2;Telerik.Web.UI:en-US:42f3bd03-686e-4514-94d4-9dc03944a160:16e4e7cd:f7645509:86526ba7:7c926187:8674cba1:b7778d6c:c08e9f8a:59462f1:a51ee93e:24ee1bba:f46195d3:1e771326:6b3f73b3:78b9daca:7165f74:58366029:2003d0b8:aa288e2d:ed16cbdc0x800a138f -

JavaScript runtime error: Unable to get property 'id' of undefined or null reference

 

 

Pavlina
Telerik team
 answered on 07 Apr 2015
2 answers
113 views

I'd like to configure RadGrid as follows:

- if there are no records to display, the grid should display only the header-row and maybe "no records to display" . Consuming no other space.

-if there are records to display, just show all records.

No fixed heiht, no paging.

Is this possible with RadGrid ??

Thanks for any help.

 

 

 

 

 

Karlheinz
Top achievements
Rank 1
 answered on 07 Apr 2015
1 answer
101 views
Hi if i download my apps source code will the backend still work from telerik also can i sell my code that i create 
Pavlina
Telerik team
 answered on 07 Apr 2015
3 answers
65 views
what is elastic functionality for radinput.

I see it listed in the release history.  Not sure what it is or how to use it.

Marty
Maria Ilieva
Telerik team
 answered on 07 Apr 2015
7 answers
291 views
Dear telerik team,

How can i bind saved image to async file upload .

thanks
Ivan Danchev
Telerik team
 answered on 07 Apr 2015
8 answers
502 views
I have a RadCombobox and I use webservice datasource. Combobox could bind data and it show checkbox items.

When I click save button, I couldn't get combobox checkeditems collection. My code is here;

<telerik:RadComboBox ID="cmbNotificationUsers" runat="server" CheckBoxes="true" EnableCheckAllItemsCheckBox="true" Width="100%" OnClientItemsRequesting="OnClientItemsRequestingForUser"
                            EmptyMessage="Select" MarkFirstMatch="true" EnableLoadOnDemand="true">       
                            <WebServiceSettings Path="../../WebServices/ControlObjects/ComboBoxes.asmx" Method="GetUsersByCompany" />
                        </telerik:RadComboBox>

foreach (Telerik.Web.UI.RadComboBoxItem item in cmbNotificationUsers.CheckedItems)
            {
                messageUsers.Add(item.Value);
            }

Thanks,
Gökhan
Aman
Top achievements
Rank 1
 answered on 07 Apr 2015
3 answers
1.0K+ views
I want to download EXE file on page load event and show real time download progress bar. After successful download, I want to execute EXE file to install on client machine.

How can I do this using RadProgressBar & RadProcessArea control??

Do any one have sample source code of this??

Please at-least take a look of my requirement, I'm researching on it since last week.
Vessy
Telerik team
 answered on 07 Apr 2015
1 answer
350 views

We are using Telerik Grid control in our application.
The Grid is getting constructed dynamically, i.e the columns to be shown in the grid is dynamic so we have created custom ItemTemplate and CustomFilterTemplate to implement this.
We have also implemented Column filtering in the Grid with combo box option.
Now, we need to make the filtering to have multiselect option. i.e. the Filter dropdown will show check box items so that user can choose multiple items to filter the Grid.
Could you please assist in this regard.
Attached file contains the screen shot of what we are trying to achieve.

Appreciate your assitance here. 

 

Konstantin Dikov
Telerik team
 answered on 07 Apr 2015
Narrow your results
Selected tags
Tags
+? more
Top users last month
Ambisoft
Top achievements
Rank 2
Iron
Pascal
Top achievements
Rank 2
Iron
Matthew
Top achievements
Rank 1
Sergii
Top achievements
Rank 1
Iron
Iron
Andrey
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Ambisoft
Top achievements
Rank 2
Iron
Pascal
Top achievements
Rank 2
Iron
Matthew
Top achievements
Rank 1
Sergii
Top achievements
Rank 1
Iron
Iron
Andrey
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?