Radgrid ItemCommand event has no controls

2 posts, 0 answers
  1. Morten Hoegh
    Morten Hoegh avatar
    1 posts
    Member since:
    Mar 2010

    Posted 26 Apr 2010 Link to this post


    Im trying to make a radgrid work with edit mode in a webpart for MOSS 2007.
    All the events fire as they should BUT I cant get the edited values in the event.

    The controls property on the edit cells has a count = 0.
    It works fine when I use the control in a normal aspx page.

    The code is:


    protected void radGrid_ItemCommand(object source, GridCommandEventArgs e)




    switch (e.CommandName)











    GridEditFormItem gridInsert = (GridEditFormItem)e.Item;



    string pNavn = ((TextBox)(gridInsert["Navn"].Controls[0])).Text;



    The .Controls[0] throw an "index out of range" because the cell holds no controls. The gridInsert["Navn"] does exist.

    Please help.


  2. Sebastian
    Sebastian avatar
    9934 posts

    Posted 26 Apr 2010 Link to this post

    Hello Morten,

    The more unified approach would be to case the e.Item argument to GridEditableItem (instead of GridEditFormItem) as it will work both for inplace and edit forms editing, i.e.:

    GridEditableItem gridInsert = (GridEditableItem)e.Item;

    Additionally, how to extract the data from the corresponding column editors you can see from the resources below:

    http://demos.telerik.com/aspnet-ajax/grid/examples/dataediting/editmodes/defaultcs.aspx (using column editors)
    http://demos.telerik.com/aspnet-ajax/grid/examples/dataediting/extractvalues/defaultcs.aspx (using server API for extraction)

    http://www.telerik.com/help/aspnet-ajax/grdaccessingcellsandrows.html (Help article)

    Best regards,
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Back to Top