Inline insert new row and populate column values

2 posts, 0 answers
  1. Stuart
    Stuart avatar
    1 posts
    Member since:
    Jan 2015

    Posted 10 Mar 2015 Link to this post

    I would like to allow the user to insert new rows inline (but not edit existing rows). The left most column will contain a dropdown list and based on the selection from the dropdown list I would like to then populate the other 4 cells in the new row with specific values which can't be changed by the user? Is this possible
  2. Daniel
    Admin
    Daniel avatar
    2230 posts

    Posted 12 Mar 2015 Link to this post

    Hello Stuart,

    In InLine editing mode the grid requires the edit command to be added in order to show the update / cancel buttons when adding a new item. If the user should not be able to edit the records with InLine editing then I can suggest either to hide the edit button via CSS:
    #grid .k-grid-edit {
        display:none;
    }

    or not add the edit command and use custom buttons that call the grid saveRow and cancelRow methods.

    As for your question about the dropdownlist - you could use the grid dataSource change event or the dropdownlist change event in order to set the other column values based on the selection. If the other columns should not be editable then I would suggest to use readonly editors. I created an example that demonstrates the described scenario.

    Regards,
    Daniel
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
Back to Top