ItemCommands for nested RadGrid

33 posts, 0 answers
  1. Srujana
    Srujana avatar
    38 posts
    Member since:
    Jan 2011

    Posted 29 Jul 2011 Link to this post

    Hi vasil,


    Please ignore the message below, I forgot to set  the following EnablePostBackOnRowClick="false".

    Thanks for all your help.

  2. Shoaib
    Shoaib avatar
    9 posts
    Member since:
    Jul 2010

    Posted 12 Mar 2013 Link to this post

    Hi n hope so you pretty fine .... I m using radgrid with NestedViewTemplate .. when I clicked last row of rad grid view so its working
    fine ... but when i try to expand on first row or second row ... so selected index of my dropdown is is not working .... :( .. atlast when
    I clicked on update button of nestedview so below error raised ....... for further assitance I m attaching snapshot... Image 3 is correct while
    image one is error one.....

    Microsoft JScript runtime error: Sys.WebForms.PageRequestManagerServerErrorException: Invalid JSON primitive: .

    Below is my Markup up...

    <asp:DropDownList ID="rcbStatusedit" runat="server" DataSourceID="SqlDataSource1"
                                                                                                                                    DataTextField="status" DataValueField="statusId" Width="160"
                                                                                                                                    SelectedValue='<%# DataBinder.Eval( Container, "DataItem.status_Id") %>'
                                                                                                                                <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:my-CSRConnectionString %>"
                                                                                                                                    SelectCommand="my query">

    My Code behind:

    protected void grvProjectTelerik_ItemCreated(object sender, GridItemEventArgs e)

                if (e.Item is GridDataItem && e.Item.OwnerTableView.Name == "Master")
                    GridDataItem item = (GridDataItem)e.Item;


                if (e.Item is GridNestedViewItem)
                    GridNestedViewItem item = (GridNestedViewItem)e.Item

                    rcbStatusedit = (DropDownList)item.FindControl("rcbStatusedit");

     void rcbStatusedit_SelectedIndexChanged(object sender, EventArgs e)
     some condition for dropdown

      protected void grvProjectTelerik_ItemCommand(object source, GridCommandEventArgs e)

      if (e.CommandName == "ExpandCollapse")
     RadScriptManager.RegisterClientScriptBlock(this, this.GetType(), "Popup", "ax_load();", true);



    I further checked my code , my dropdown selected index is always correc for last row of grid , while dropdown selected index is always zero (0) , when I expanding row 1,2 . In last row I m retrieving correct index.


  3. Vasil
    Vasil avatar
    1604 posts

    Posted 15 Mar 2013 Link to this post


    It is odd that you are getting the exception only for the first 2 rows of the grid. What is the difference in the rows, do you have some different values in the combo box, some of the that to contains quotes for example, that might break the page validation during the submit? About the screenshots, I don't see some particular difference in them that to lead us understanding the issue. If the problem is actually visible in the screenshots, please explain what exactly should be looking for.

    Kind regards,
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Back to Top