I have a kendo grid in inline editing mode. When I press "Add new item" button, new row is added. some editable fields are ForeignKey column in the grid, if i fill the text fields in the new records without filling or select the dropdownlist fields for ForeignKey columns, a null values are set for ForeignKey fields.
the question , how to enforce the user to select dropdownlist and make this field is required on "update" button click action.
i am using ASP.NET MVC 4.0 and Kendo UI for ASP.NET MVC Q2 2013.
Make sure your dropdownlists are binded to non nullable values, and are you using the EditorTemplate provided for the foreign key columns?
Related
So I have a standard Kendo grid in MVC with 2 non-editable columns. What I would like to achieve is to enable editing of all columns only within the newly added rows.
Example: There's 4 rows already in the grid, first 2 columns non-editable. User clicks "Add new", a new record appears in the grid with everything editable.
Try adding an editable function handler to your column definition, something like this:
{
field: "salary",
editable: function (dataItem) {
return dataItem.isNew();
}
}
Please note: you will need to have specified an id column in your model definition for this to work, for details see isNew documentation:
Checks if the Model is new or not. The id field is used to determine if a model instance is new or existing one. If the value of the field specified is equal to the default value (specified through the fields configuration) the model is considered as new.
I have a foregin key bound column in Kendo grid, I have to add change event on the kendo dropdown , so that i can populate others nested dropdown inside kendo grid.
columns.ForeignKey(c => c.City)
Any help would be appreciated!!
I'm using kendo ui dropdownlist component (not the wrapper) in my Asp.net mvc 4 project.
We are not using kendo ui validator.
I want to use html5 required attribute for this field. But when I set required attribute, when no value is selected, it does not give any message, also does not submit. But when I use simple (select tag):
<select required="required">
<option></option>
...
</select>
It works; When I not select a value, it does not submit and gives an error message (html5 required attribute).
Is it possible that for kendo ui dropdownlist behaves exactly like normal html select component.
Yes it is possible.
You can add a select event to the kendo dropdown and check if any value is selected or not. If no value is selected you can raise a warning before submitting the form.
I want to populate values in a list box based on a value entered in textbox. It cant be aceived through cascading paramters as all parameters in Cascading parameters are List Boxes. But my requirement is to populate values inside a ListBox based on the value entered inside a textbox. Please help.
Cascading parameter is the only way to define a dependency between two parameters. As you can see, the birt web viewer displays a textbox just below each combobox, and a radio button to select if we fill each list parameter from the combobox or the textbox:
I know some users had exactly the same requirement, and have successfully modified "ComboBoxParametersFragments.jsp" to display only the textbox when it is needed. For example we can use a specific prefix in the parameter name, or a user property, so that we can decide in the JSP if we hide the combobox or not.
I am working on a model criteria builder. I have a dropdown list with all of the model properties, a dropdown list with static operators (less than, equals, like, etc) and a user input form element for the value. The issue is that the form element type (dropdown, date, text box, etc) for the user input value needs to be based on the data type of the model property chosen in the first dropdown list. What is the best way to achieve this using MVC 2? Ideally I would like to just create an Html extension method and use it like Html.CriteriaFilterFor(model => model) and be able to customize the display using model attributes and metadata.
You should use JQuery to populate the other one. An AJAX call would allow you to pull the second drop down's list. Populating Dropdownlist Using MVC2 Based On Another Dropdownlist (Cascading DropDownList)