This is a migrated thread and some comments may be shown as answers.

Inline insert new row and populate column values

1 Answer 173 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Stuart
Top achievements
Rank 1
Stuart asked on 10 Mar 2015, 10:53 AM
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

1 Answer, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 12 Mar 2015, 08:40 AM
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.

 
Tags
Grid
Asked by
Stuart
Top achievements
Rank 1
Answers by
Daniel
Telerik team
Share this question
or