Open Radgrid in Edit mode after Insert

5 posts, 0 answers
  1. Manav
    Manav avatar
    25 posts
    Member since:
    Oct 2010

    Posted 26 Dec 2010 Link to this post

    I have different controls in add and edit mode in my Radgrid. However, i want my grid to open in Edit mode immediately once the Add button is clicked. Is this possible? if yes , can some one tell me how ?

    Thanks    
  2. Iana Tsolova
    Admin
    Iana Tsolova avatar
    3388 posts

    Posted 27 Dec 2010 Link to this post

    Hi Mark,

    You can refer to this article illustrating how you can use different edit and insert forms for the grid.
    However, can you specify if you want the edit and insert form to be opened at the same time?

    Kind regards,
    Iana
    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.
  3. Manav
    Manav avatar
    25 posts
    Member since:
    Oct 2010

    Posted 27 Dec 2010 Link to this post

    Hi Iana ,
          I basically want to fire the edit command after the item is inserted. We have a couple of additional controls which are visible only when we try to edit the record. The controls indicate child entries for the main record of the grid. Hence, we cant show them until the parent record is populated in the database
    we now want these records to be populated immediately once the insert is fired. So after the insert, we want the same record to be opened as if the edit command was fired.  In other words, the itemdatabound should open this record with editmode. I have tried setting the .edit property to true and rebinding the grid but it doesnt work.
    Hope this clears my query.
    Regards,
    Mark
  4. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 27 Dec 2010 Link to this post

    Hello Mark,

    One suggestion is to try the following approach to make the last inserted record in edit mode.
    First you need to find the last inserted record, then in PreRender find the row index of newly inserted record and put that row in edit mode. You can use the logic in the following Code Library to achieve this.
    Select Last Inserted Row

    Thanks,
    Princy.
  5. Manav
    Manav avatar
    25 posts
    Member since:
    Oct 2010

    Posted 28 Dec 2010 Link to this post

    Hi Princy,
       I have tried using the item.Selected = true in my pre-render for the last row that was inserted but it does not just do it.
    I finally solved that problem though by adding the item.edit = true property and rebinding the grid which makes the grid editable

    Thanks for the help though.

    Regards,
    Mark
Back to Top