Telerik Forums
UI for ASP.NET MVC Forum
10 answers
1.7K+ views
Hi Kendo community,

I don't really understand how the selected objects out of a multiselect can be sent to the controller. The databinding out of the db works fine and I'm also able to select and remove items in the multiselect. By the way the multiselect is displayed inside a kendo window and posts with an ajax.beginform.

My multiselect looks like this:

@model SoftwareAdminInterface.Models.Administration.Pattern
@
using (Ajax.BeginForm("SetCombi", "Pattern", new { }, new AjaxOptions() { HttpMethod = "post", UpdateTargetId = "myContentPopupEditRole_div" }))
  
@(Html.Kendo().MultiSelect()
                    .MaxSelectedItems(2)
                    .Name("RegExID")
                    .DataTextField("RegExName")
                    .DataValueField("RegExID")
                    .Placeholder("Select Patterns...")
                    .AutoBind(false)    
                    .DataSource(source => {
                        source.Read(read =>
                        {
                            read.Action("GetPatternsForCombi", "Pattern");
                        })
                    .ServerFiltering(true);
          })
    )

What I want to do now is to pass the two selected RegExID's over to the controller. Controller action looks like this:
[AcceptVerbs(HttpVerbs.Post)]
        public ActionResult SetCombi([DataSourceRequest] DataSourceRequest request, List<Pattern> selectedPatterns)
        {
            SoftwareHelper helper = new SoftwareHelper();
 
            return PartialView("Combination");
        }

basically I thought of getting the IDs from the List<Pattern>, but the list is null.
any advise?

thx in advance
kind regards
jay taylor
Top achievements
Rank 1
 answered on 08 Feb 2018
4 answers
397 views

I have a grid  with a create tool bar.

.ToolBar(toolbar => toolbar.Create().Text("Add new Inspection"))

 

My grid is set to editable with a template.

.Editable(editable => editable.Mode(GridEditMode.PopUp).Window(w => w.Width(600)).TemplateName("Inspection"))

 

My data source is pretty standard.

.DataSource(dataSource => dataSource
        .Ajax()
            .Model(model => model.Id(Inspection => Inspection.DEPInspectionsID))
            .Read(read => read.Action("InspectionItems_Read", "Inspections"))
            .Create(create => create.Action("InspectionItem_Create", "Inspections"))
            .Update(update => update.Action("InspectionItem_Update", "Inspections"))
            .Destroy(destroy => destroy.Action("Inspections_Destroy", "Inspections"))
        )

 

When I click on the standard Update button on the pop up it calls the InspectionItem_Create action once for the new record, but then it also calls it again for each of the other records on the list as well...

Why would a single click of the update button trigger the function for not only for the item created using the model... but for all of the additional items in the list?

 

Stefan
Telerik team
 answered on 08 Feb 2018
3 answers
640 views

Hi,

I have 3 grids each one in another tab (another view).

for each one of them I have different Kendo extend validation  for example:

function ($, kendo) {
    $.extend(true, kendo.ui.validator, {
        rules: { // custom rules
            dateValidation: function (input, params) {
                debugger;
                if (input.is("[name='ActualStartDate']") && input.val() != "") {
                    var startDate = kendo.parseDate(input.val());
                    var endDate = kendo.parseDate($('#ActualEndDate').val());
                    if (startDate != null && endDate != null) {
                        input.attr("data-dateValidation-msg", "Start date should be before End date");
                        return startDate.getTime() <= endDate.getTime();
                    }
                } else if (input.is("[name='ActualEndDate']") && input.val() != "") {
                    var endDate = kendo.parseDate(input.val());
                    var startDate = kendo.parseDate($('#ActualStartDate').val());
                    if (startDate != null && endDate != null) {
                        input.attr("data-dateValidation-msg", "End date should be after Start date ");
                        return startDate.getTime() <= endDate.getTime();

                    }
                }
                if (input.is("[name='Description']") && input.val() != "") {
                    debugger
                    input.attr("data-dateValidation-msg", "A Description Cannot Be Longer Than 250 Characters");
                    return (input.val().length <= 250)

                }
                      
                return true;
            }
        },
        messages: { //custom rules messages
            dateValidation: function (input) {
                // return the message text
                return input.attr("data-val-dateValidation");
            }
        }
    });
})(jQuery, kendo);

 

 

because of cache , sometimes the the wrong validator is called and then the validation  went wrong.

How can I force that the right validator will be called? is there some unique name for each one?

 

 

Thank you

 

Stefan
Telerik team
 answered on 07 Feb 2018
1 answer
214 views

Currently a tornado chart is not available in the Kendo Charts library. Is there a way to create tornado charts with telerik html charts?

Example is attached below for your reference.

Stefan
Telerik team
 answered on 07 Feb 2018
1 answer
231 views
Under the React Data Query library, there are examples of doing the filtering/sorting in memory with local data: https://www.telerik.com/kendo-react-ui/components/dataquery/

And there's a page about Integration with UI for ASP.NET Core that shows the standard backend configuration for a DataqSourceRequest/ToDataSourceResult MVC configuration: https://www.telerik.com/kendo-react-ui/components/dataquery/mvc-integration/

But there's no information about how you configure a Kendo React component, for example a grid, to use the MVC Operations. Is there an example anywhere I have missed?
Vasil
Telerik team
 answered on 07 Feb 2018
3 answers
152 views

I have a gird with a toolbar template where I have a pair of cascading drop down lists and an add new button.

The 1st one is Category and the 2nd is Sub Category which Cascades from Category...

01..ToolBar(toolbar => { toolbar.Template(
02.            @<text>
03.                @(Html.Kendo().DropDownList()
04.                    .Name("ddlCategory")
05.                    .DataTextField("Text")
06.                    .DataValueField("Value")
07.                    .OptionLabel("Select a Category...")
08.                    .HtmlAttributes(new { style = "width: 250px;" })
09.                    .DataSource(source => {
10.                        source.Read(read => { read.Action("Categories_Read", "Categories"); });
11.                    })
12.                )
13.                @(Html.Kendo().DropDownList()
14.                    .Name("ddlSubCategory")
15.                    .DataTextField("Text")
16.                    .DataValueField("Value")
17.                    .OptionLabel("Select a Sub Category...")
18.                    .HtmlAttributes(new { style = "width: 250px;" })
19.                    .DataSource(source => {
20.                        source.Read(read => { read.Action("SubCategories_Read", "Categories").Data("filterSubCategories"); }).ServerFiltering(true);
21.                    })
22.                    .AutoBind(false).Enable(false).CascadeFrom("ddlCategory")
23.                 )
24.                <a class="k-button k-button-icontext k-grid-add" href="#"><span class="k-icon k-i-add"></span>Add New Contract Item</a>
25.            </text>); })

 

I've set up the datasource model as follows:

1..Model(model =>
2.{
3.    model.Id(p => p.ContractItemID);
4.    model.Field(p => p.Category).DefaultValue("Category");
5.    model.Field(p => p.SubCategory).DefaultValue("Sub Category");
6.})

 

I'm also grouping on Category and SubCategory and I have created a function for the edit event:

1..Group(groups => { groups.Add(p => p.Category); groups.Add(p => p.SubCategory); } )
2..PageSize(20))
3..Events(e => e.Edit("getCategoryVals"))

 

The two issues I'm running into is this:

First, I've followed documentation and demos from multiple locations, and I cannot grab the text from the drop down... I'm using the following code... but on line 06 the script fails with an error that .text is not defined.

01.function getCategoryVals(e) {
02.     
03.    var ddlCategory = $('#ddlCategory');
04.    var ddlSubCategory = $('#ddlSubCategory');
05. 
06.    var tsCategory = ddlCategory.data('kendoComboBox').text();
07.    var tsSubCategory = ddlSubCategory.data('kendoComboBox').text();
08. 
09.    e.model.set("Category", tsCategory);
10.    e.model.set("SubCategory", tsSubCategory);
11.}

 

And Second... If I hard code tsCategory and tsSubCategory, it updates the model and the fields in the new row reflect the new values, BUT the grouping label still shows Category and Sub Category instead of the actual value... I want these fields to be hidden....

Do I have to manually update the grouping labels using jquery or is there a better way to do this?

 

 

Stefan
Telerik team
 answered on 07 Feb 2018
1 answer
213 views

Does the PDF exporter have built in functionality to build a TOC?  One way I thought about doing this was using hash anchors.  Is that supported? 

Thanks!

Stefan
Telerik team
 answered on 06 Feb 2018
2 answers
823 views

HI

I have a question about Theme Builder.

I have a new project and customer want to customize the theme for ALL Telerik Controls (Button, Grid, etc).
I have try the Sass Theme Builder but this theme builder unable to customize Grid's appearance : 

Sass Theme Builder
https://docs.telerik.com/kendo-ui/styles-and-layout/sass-themes#sass-theme-builder

And I have found and try the Kendo UI ThemeBuilder, but the error occurred (opened by Google Chrome) :

Kendo UI ThemeBuilder
https://demos.telerik.com/kendo-ui/themebuilder/

--

How could I customize the theme for ALL Telerik Controls (Grid, etc.) ?

And how could I generate following theme files
(kendo.xxxxx.min.css, kendo.dataviz.xxxxx.min.css, kendo.xxxxx.mobile.min.css) : 

Blue Opal theme files : 

  Content/kendo/2017.2.621/kendo.blueopal.min.css
  Content/kendo/2017.2.621/kendo.dataviz.blueopal.min.css
  Content/kendo/2017.2.621/kendo.blueopal.mobile.min.css

*blueopal - Maybe new theme name.
*2017.2.621 - kendo ui version only.
*Google Chrome version: 63.0.x.x 32bits

Best regards

Chris

 

 

 

Ivan Zhekov
Telerik team
 answered on 05 Feb 2018
1 answer
1.6K+ views

Hi,

I want to add a specific class to the inputs in Inline editing .

How can I do it?

thanks

Viktor Tachev
Telerik team
 answered on 02 Feb 2018
3 answers
941 views

Hi,

at the moment I am converting the old Telerik MVC tool to Kendo MVC for one of our portals.

now I have an issue with a dynamic table, not always all fields are the same and I can't get it to work correctly.

my grid looks like this

@(Html.Kendo().Grid(Model.DefaultView)
                            .Name("Grid")
                            .DataSource(dataSource => dataSource
                                        .Ajax()
                                        .Read(read => read.Action("LoadData", "AutorisatieMatrix"))
                                        .Update(read => read.Action("_SaveBatchEditing", "AutorisatieMatrix"))
                                        .Model(model => model.Id("ProgramFunction"))
                                    )
                            .Sortable()
                            .Editable(editing => editing.Mode(GridEditMode.InCell))
                                .ToolBar(commands =>
                                {
                                    commands.Save();
                                })
                            .Columns(columns =>
                            {
                                columns.Bound("Id").Visible(false);
                                foreach (System.Data.DataColumn dcol in Model.Columns)
                                {
                                    if (dcol.ColumnName != "Id")
                                    {
                                        if (dcol.ColumnName == "ProgramFunction")
                                            columns.Bound("ProgramFunction")
                                                .EditorTemplateName("_ReadOnlyValue")
                                                .ClientTemplate("#=ProgramFunction#")
                                                .Title("Programmafunctie");
                                        else
                                        {
                                            columns.Bound(dcol.ColumnName)
                                                .EditorTemplateName("_PermissionEditor")
                                                .ClientTemplate(boo(this, "#=" + dcol.ColumnName + "#").ToHtmlString())
                                                .Title(dcol.Caption)
                                                ;
                                        }
                                    }
                                }
                            })

 

where I go through all colums specified in the model.
and the header gets created as it should.

In the controller in the Index I create an empby DataTable so the Model knows which colums to use.

public ActionResult Index()
        {
            var tbl = CreateNewDataTable();
            var model = tbl;
            return View(tbl);
        }

which seems to work fine.

Then In the loadData DataRequest I generate this same DataTable fill it, add a dynamic wrapper to include "Data" in the json
Convert is to Json and return the Content.

 

 

 

sjarl
Top achievements
Rank 1
 answered on 02 Feb 2018
Narrow your results
Selected tags
Tags
Grid
General Discussions
Scheduler
DropDownList
Chart
Editor
TreeView
DatePicker
ComboBox
Upload
MultiSelect
ListView
Window
TabStrip
Menu
Installer and VS Extensions
Spreadsheet
AutoComplete
TreeList
Gantt
PanelBar
NumericTextBox
Filter
ToolTip
Map
Diagram
Button
PivotGrid
Form
ListBox
Splitter
Application
FileManager
Sortable
Calendar
View
MaskedTextBox
PDFViewer
TextBox
Toolbar
Dialog
MultiColumnComboBox
DropDownTree
Checkbox
Slider
Switch
Notification
Accessibility
ListView (Mobile)
Pager
Security
ColorPicker
DateRangePicker
Wizard
Styling
Chat
DateInput
MediaPlayer
TileLayout
Drawer
SplitView
Template
Barcode
ButtonGroup (Mobile)
Drawer (Mobile)
ImageEditor
RadioGroup
Sparkline
Stepper
TabStrip (Mobile)
GridLayout
Badge
LinearGauge
ModalView
ResponsivePanel
TextArea
Breadcrumb
ExpansionPanel
Licensing
Rating
ScrollView
ButtonGroup
DropDownButton
CheckBoxGroup
NavBar
ProgressBar
QRCode
RadioButton
Scroller
Timeline
TreeMap
TaskBoard
OrgChart
Captcha
ActionSheet
Signature
DateTimePicker
AppBar
BottomNavigation
Card
FloatingActionButton
Localization
MultiViewCalendar
PopOver (Mobile)
Ripple
ScrollView (Mobile)
Switch (Mobile)
PivotGridV2
FlatColorPicker
ColorPalette
AIPrompt
PropertyGrid
ActionSheet (Mobile)
BulletGraph
Button (Mobile)
Collapsible
Loader
CircularGauge
SkeletonContainer
Popover
HeatMap
Avatar
ColorGradient
CircularProgressBar
SplitButton
StackLayout
TimeDurationPicker
Chip
ChipList
DockManager
ToggleButton
Sankey
OTPInput
ChartWizard
SpeechToTextButton
InlineAIPrompt
TimePicker
StockChart
RadialGauge
ContextMenu
ArcGauge
AICodingAssistant
SmartPasteButton
PromptBox
SegmentedControl
LLM Kit
+? more
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?