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

[Solved] ItemHierarchicalIndex

2 Answers 304 Views
Grid
This is a migrated thread and some comments may be shown as answers.
RvdGrint
Top achievements
Rank 1
RvdGrint asked on 12 Sep 2011, 09:21 AM

Hello,

I've a RadGrid with a ButtonColumn of type ImageButton. When adding an CommandArgument to this column the error: 'Specified argument was out of range of valid values. Parameter name: ItemHierarchicalIndex'.

<telerik:GridButtonColumn ButtonType="ImageButton" ImageUrl="~/Images/RadGrid/16pxSearch.png" CommandName="Edit" CommandArgument="View" UniqueName="ViewColumn">
  <HeaderStyle CssClass="rgHeader ButtonColumnHeader"></HeaderStyle>
  <ItemStyle CssClass="ButtonColumn"></ItemStyle>
</telerik:GridButtonColumn>

Anyone any idea how to fix it??

Regards,
  Jos Meerkerk

2 Answers, 1 is accepted

Sort by
0
RvdGrint
Top achievements
Rank 1
answered on 12 Sep 2011, 09:53 AM
I've some additional information.

I've defined an OnCommand client-event for this RadGrid. When removing the event the error doesn't occur, but I need that OnCommand event for disabling AJAX for some commands.
<ClientSettings>
  <ClientEvents OnCommand="gridCommand" />
</ClientSettings>

function gridCommand(sender, args) {
 
    if (args.get_commandName() == "DownloadAttachment") {
         
        var gridID = sender.get_id();
        var grid = document.getElementById(gridID);
 
        var manager = $find(grid.parentNode.parentNode.id);
 
        if (manager) {
            manager.set_enableAJAX(false);
 
            setTimeout(function () {
                manager.set_enableAJAX(true);
            }, 0);
        }
    }

Regards
  Jos Meerkerk
0
Marin
Telerik team
answered on 15 Sep 2011, 08:18 AM
Hello Jos,

When the OnCommand event is attached the command is fired from the client with the fireCommand method. It expects the argument for the Edit command to be the hierarchical index of the current edited item. It your case the argument is the string "View" which causes exception. You should either pass the correct argument to the edit command or you can use another event to cancel some of the ajax command such as the OnRequestStart of the AjaxManager.

Greetings,
Marin
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal
Tags
Grid
Asked by
RvdGrint
Top achievements
Rank 1
Answers by
RvdGrint
Top achievements
Rank 1
Marin
Telerik team
Share this question
or