How to create filter for checkbox in kendo Grid MVC - asp.net-mvc

I need to have a filter on my kendo grid for check box.
The checkbox is a Non-Bound column. Using checkbox I select the corresponding row.
I need to have a filter to get all the rows which are selected and not selected on the checkbox
columns.Template(#<text> </text>).ClientTemplate("<input type='checkbox' class='chkbx'").Title("Select");
Kindly help....

The best way to achieve such functionality is to extend your data source and add boolean column in your datasource definition. Then you will able to apply custom filter like this:
dataSource.filter({ field:"Field", operator: "eq", value: true });
As far I know - there is no build kendo way to manage filtering unbounded columns.

Related

Is there a way to enable row editing on only new added rows within a Kendo grid?

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.

Adding fields to form based on a value in MVC 5

I have a drop down in my view. Say the selected value is 1, I want to show the next field as textbox.
#f.FormGroup().TextBoxFor(model => model.Parameter)
If the selected value is 2, then i need it as a dropdown with a list of values.
#f.FormGroup().DropDownListFor(model => model.Parameter, Model.ForumList)
If the selected value is 3, then i need to hide the parameter.
What is the best way to acheive this?
Thanks in advance,
Vanitha.
Add a function inside javascript that should be called onChange event of your dropdownlist. Pass the value of dropdown to that on change function and use if condition to decide which element to show, for this purpose you can keep a div and append elements inside it on runtime
function myfunc(dropValue)
{
if(dropValue==1)
document.getElementbyId('yourdiv').innerHtml=//the html for your element in ''
}

Kendo-UI DropDownListFor - selected index

I need to change standard dropdown list to the one from kendo and and I've got a problem with getting appropriate selected value.
This code gives me a dropdown list with correct values, but doesn't give selected value (first one is selected).
#(Html.Kendo().DropDownListFor(m => m.CountryName)
.BindTo(Model.AllCountries)
.OptionLabel("-- Select country --")
)
Inside span (generated by kendo) with this dropdown I found input (type = text) with all values as options, and this input has correct value.
How to display this value in my kendo dropdown?
Thanks
Have you tried setting the name of the DropDownList equal to the name of the property in your model? The Kendo Documentation suggests that "if widget's name is different than the Model's property then the ModelBinder will not be able to update the model."

how to populate values in listbox based on value entered in textbox in BIRT?

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.

Asp.NET MVC 2 dynamic editor template based on dropdown value

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)

Resources