Update
This should be a UI for ASP.NET Core question, so I Reposted it here
Scenario:
I am trying to enable and disable CheckBoxGroup items,
and it dependes on whether if the categories of the item has values.
For example, If there are two categorie, which are animals and fruits.
If I recieved no datas of fruits, I'll disabled the CheckBoxGroup item "fruits".
What I've tried so far
I search through documents and found this tutorial of the BindTo() method,
However, I got an error message saying "Cannot convert from System.Collections.Generic.List<MyCheckBoxItemModel> to string []
Questions
1. According to the method, how can I convert List<model> to string[] in my .cshtml ?
2. (Extension Question) In the tutorial, I'm awared that in the "InputGroupItemModel" there was a "Enabled" attribute.
Is it mean that if passed it to the front end and attached it with the BindTo() method, the CheckBoxGroup will automatically enable or disable the checkbox item?
(I'll show my code below)
Code
CheckBoxItemDto.cs
public class CheckBoxItemDto
{
//public IDictionary<string, object> HtmlAttributes { get; set; }
//public string CssClass { get; set; }
public bool? Enabled { get; set; }
//public bool? Encoded { get; set; }
public string Label { get; set; }
public string Value { get; set; }
}
CheckBoxItemViewModel.cs
public class CheckBoxItemViewModel
{
public List<CheckBoxItemDto> Items { get; set; }
public string[] CheckBoxGroupValue { get; set; }
}
MyViewModel.cs
public class EqInstsDataViewModel
{
public IEnumerable<MyOtherViewModel> MyOtherViewModel { get; set; }
public CheckBoxItemViewModel CheckBoxItemViewModel { get; set; }
}
Controller
public IActionResult GetChartPartialView()
{
try
{
List<CheckBoxItemDto> checkBoxItemDto = GetCheckBoxItem(); //Get CheckBox Items
CheckBoxItemViewModel checkBoxItem = new CheckBoxItemViewModel() { Items = checkBoxItemDto };
MyViewModel myViewModel = new MyViewModel() { Items = checkBoxItem }
return PartialView("~/Views/Shared/_MyPartialView.cshtml", myViewModel);
}
catch (Exception ex)
{
return Json(ex.Message);
}
}
public List<CheckBoxItem> GetCheckBoxItem()
{
try
{
#region CheckBoxItems
var itemsList = new List<CheckBoxItemDto>()
{
new CheckBoxItemDto()
{
Label = "Animals",
Value = "1",
Enabled = true
},
new CheckBoxItemDto()
{
Label = "Friuts",
Value = "2",
Enabled = false
} ,
};
#endregion
return itemList;
}
catch(Exception)
{
throw;
}
}
_MyPartialView.cshtml
@(Html.Kendo().CheckBoxGroup()
.Name("MyCheckBox")
.BindTo(Model.CheckBoxItemViewModel.Items) //Cannot convert from List<CheckBoxItemDto> to string[]
.Value(Model.CheckBoxItemViewModel.CheckBoxGroupValue)
.Layout("horizontal")
)
Would like to check if I am able to achieve this layout using the kendo grid, or any other control of kendo?
Hi,
I checked your AutoComplete and MultiColumnComboBox examples.But any example , you did not send a parameter to Controller using by UI Jquery AutoComplete and MultiColumnCombobox.How to send a parameter to Controller for server filtering? When I try to implement your example codes, The parameter i send to controller returns null.
Hi
i need change Font and Rotation labels in yAxis , but not applying
this problem also exists in xAxis mode
thank you
we have a field in which the source value is an array of objects, to edit it we use kendoMultiSelect, to show we just concat the values:
this.MultiSelectEmployeeClassesArrayToString = function (item) {
return item.EmployeeLicensingClasses
.map(function (employeeClass) { return employeeClass.Description; })
.join(', ');
},
is there a way to make filtering work as a contains for example & sort just the value we display (concatenating)?
What is the best way to customize the timestamp location and format?
We've tried using templates but can only control those rendered from chat.renderMessage, it's not clear how to use a different template from the user's posted message (ie we only know how to control the left-side not the right-side message bubbles)
The documentation has no information on this and were only able to piece together from other forum posts
Hello, I am having a hard time getting this to work even after following solutions such as these:
http://docs.telerik.com/aspnet-mvc/helpers/grid/how-to/Export/detail-grid-export
I have a main grid, and detail grid that can go up to 5 levels down, and wish to export the child data as well as the main data in the same workbook. I have attached what my actual grid looks like in action (had to redact some text):
Main Grid:
@(Html.Kendo().Grid<...>()
.Name("...")
.Scrollable(s => s.Height("auto"))
.HtmlAttributes(new { @class = "hidden", style = "height: 100%" })
.Columns(columns =>
{
columns.Bound(...)
.ClientDetailTemplateId("gridTemplate")
.Events(e => e.DataBound("onMainGridDataBound").ExcelExport("onMainGridExcelExport").DetailInit("onMainGridDetailInit"))
.Sortable()
.Excel(xls => xls.FileName("Export.xlsx"))
.Pdf(pdf => pdf.FileName("Export.pdf"))
.DataSource(dataSource => dataSource
.Ajax()
.Model(model =>
{
...
})
.Group(...)
.Read(read => read.Type(HttpVerbs.Post).Action("..", "Grid").Data("..."))
.Events(events =>
{
events.RequestEnd("onMainGridRequestEnd");
events.Error("onError");
})
)
)
Detail Grid:
<script type="text/x-kendo-template" id="gridTemplate">
@(Html.Kendo().Grid<...>()
.Name("..._#=UniqueId#")
.Columns(columns =>
{
columns.Bound(...)
.Pageable()
.Sortable()
.Excel(xls => xls.FileName("Detail Export.xlsx"))
.ClientDetailTemplateId("gridTemplate")
.Events(e => e.DataBound("onMainGridDataBound").ExcelExport("onDetailGridExcelExport").DetailInit("onMainGridDetailInit"))
.ToClientTemplate()
)
</script>
Hello!
I could not manage to implement a combobox widget with virtualization if the text/value fields are set with values which are not in the datasoruce:
Here is an example code:
$("#orders").kendoComboBox({
template: '#= OrderID # | #= ShipName #',
dataTextField: "ShipName",
dataValueField: "OrderID",
text: 'Not in the list',
value: 0,
virtual: {
itemHeight: 26,
valueMapper: function(options) {
$.ajax({
url: "https://demos.telerik.com/kendo-ui/service/Orders/ValueMapper",
type: "GET",
dataType: "jsonp",
data: convertValues(options.value),
success: function (data) {
options.success(data);
}
})
}
},
height: 520,
dataSource: {
type: "odata",
transport: {
read: "https://demos.telerik.com/kendo-ui/service/Northwind.svc/Orders"
},
pageSize: 80,
serverPaging: true,
serverFiltering: true
}
});
Requirements:
We have to create a Kendo Ui JQuery Wizard with dynamic number of steps. We want to develop the registration page exactly like:
But it has to be in Kendo UI JQuery Wizard. Can you please guide me how to achieve this. I have tried the following code but it is not working.
Please see the attached code.
Thank you,
Gururaj