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

Update Default Value when other dropdownlist changes

1 Answer 116 Views
Grid
This is a migrated thread and some comments may be shown as answers.
David
Top achievements
Rank 1
David asked on 03 May 2016, 12:47 AM

I have a categories dropdown list in the grid that i am populating very similar to the 'Editing custom editor' example. I populate the default categories in the index() method of my controller, just like the example shows and it works fine. When a 'organization dropdownlist' is chosen, I want to repopulate the categories based on what organization was chosen, but when I try to 'Add new record' in the grid, the old categories remain bound to the grid and it doesn't save properly.

 

I have in my grid something similar to this defined for the default value:

model.Field(p => p.Category).DefaultValue(ViewData["defaultCategory"] as Kendo.Mvc.Examples.Models.CategoryViewModel);

Every time a new organization dropdown item is chosen, and a read operation occurs, how would I update or rebind the model to reflect the new defaultCategory?

 

Thanks in advance,

Dave

1 Answer, 1 is accepted

Sort by
0
Pavlina
Telerik team
answered on 04 May 2016, 04:10 PM
Hello,

Check the forum threads below where a similar question is discussed:
http://www.telerik.com/forums/custom-editor-dropdown-not-sending-default-values-on-crud-add
http://www.telerik.com/forums/how-to-set-default-values-to-a-grid-when-adding-new-row

Regards,
Pavlina
Telerik
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 Feedback Portal and vote to affect the priority of the items
Tags
Grid
Asked by
David
Top achievements
Rank 1
Answers by
Pavlina
Telerik team
Share this question
or