Edit mode for detailtable

4 posts, 0 answers
  1. Dave
    Dave avatar
    38 posts
    Member since:
    Jul 2007

    Posted 07 Aug 2009 Link to this post


    I have a grid that contains one detail table. I am binding both the master and detail table in code. I am trying to get inplace editing to work for the detail table and am having some problems. When i click my edit button, i handle the itemcommand event and proceed to put the grid item (e.item) into edit mode (e.item.edit=true). I then rebind the grid, except that i never get into the edititem for the itemdatabound event for hte detail table. I am using this method for the master table and it works great for that. Is there a trick for putting a row into edit mode in a detail table?
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 10 Aug 2009 Link to this post

    Hi,

    For RadGrid if you are using an auto-generated Edit column or a GridEditCommandColumn, you do not have to use any code behind approach to set the item in edit mode. If you are using a GridButtonColumn you just need to set the CommandName property to Edit for achieving the editing functionality. If this does not help I would suggest you to send your aspx code.
    Update/Insert/Delete in Hierarchy

    Thanks
    Shinu

  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Dave
    Dave avatar
    38 posts
    Member since:
    Jul 2007

    Posted 10 Sep 2009 Link to this post

    I have a templatecolumn that contains an imagebutton in its itemtemplate. When the button is clicked, I handle the itemcommand event of the grid. I then look for the commandname of the imagebutton. Again, this was a button of a row of the detail table, so when i handle the commandname, i put the row into edit mode (e.item.edit=true) and then call grid.rebind(). As i described above, i never hit the edititem case for the itemdatabound for my detail row. And when the page comes back, the master row is expanded but detail table is gone. 

    Is there a way to put a detailtable row into edit mode from code, specifically from the ItemCommand?
  5. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 11 Sep 2009 Link to this post

    Hello,

    You can try out the following code to set the detailtable row in EditMode:
    c#:
    protected void RadGrid1_ItemCommand(object source, GridCommandEventArgs e) 
        { 
            if (e.CommandName == "CustomCommand"
            { 
                e.Item.Edit = true
                e.Item.OwnerTableView.Rebind(); 
            } 
        } 

    Thanks
    Princy.
Back to Top