Telerik Forums
UI for ASP.NET MVC Forum
2 answers
415 views

We have a Web API where the controller classes implements ApiController. 

The CRUD-operations looks like:

public IHttpActionResult Get()
public IHttpActionResult Get(int id)
public int Post(Company company)
public void Put(Company company)
public void Delete(int id)

Adding a Kendo UI ASP.NET MVC Grid that view data works, but we got stuck binding to datasource when we tried to implement inline-editable rows. 

The API methods on the demo page, https://demos.telerik.com/aspnet-mvc/grid, takes a DataSourceRequest as a parameter. 
Here it gets confusing especially when the documentation is not so comprehensive.

Can't we just use our API as it is, do we need to create yet another class where all the CRUD-operations takes the DataSourceRequest parameter?

 

Johan
Top achievements
Rank 1
 answered on 08 Oct 2018
5 answers
249 views

if I add:

.Group(g => {
                g.Add(c => c.DistrictName);
                g.Add(c => c.SchoolName);
                })

to my datasource:

.DataSource(ds => ds
            .Ajax()
            .ServerOperation(false)
            .Read(read => read.Action("RetrieveReqStatusReport", "ReportSupport", new { orgId = ViewBag.OrgSelection.Id, personId = ViewBag.PersonId, yearId = ViewBag.YearSelection.Id }))
            .PageSize(50)
            .Group(g => {
                g.Add(c => c.DistrictName);
                g.Add(c => c.SchoolName);
                })
        )

then

 function filterMenuInit(e) {
        if (e.field == "DueDate") return;
        var filterMultiCheck = this.thead.find("[data-field=" + e.field + "]").data("kendoFilterMultiCheck")
        filterMultiCheck.container.empty();
        filterMultiCheck.checkSource.sort({ field: e.field, dir: "asc" });

        filterMultiCheck.checkSource.data(filterMultiCheck.checkSource.view().toJSON());
        filterMultiCheck.createCheckBoxes();
    }

generates the following error when I try to filter:

Uncaught ReferenceError: DistrictName is not defined
    at eval (eval at compile (kendo.all.min.js:25), <anonymous>:3:209)
    at Object.render (kendo.all.min.js:25)
    at Object.d [as render] (jquery.min.js:2)
    at init.createCheckBoxes (kendo.all.min.js:45)
    at init.filterMenuInit (1:371)
    at init.trigger (kendo.all.min.js:25)
    at init.c (kendo.all.min.js:53)
    at init.trigger (kendo.all.min.js:25)
    at init._init (kendo.all.min.js:45)
    at init._click (kendo.all.min.js:45)

if I remove it, multi-filter works fine.

TIA for the insight into what I'm failing to understand.

SEAN
Top achievements
Rank 1
 answered on 07 Oct 2018
3 answers
817 views

Hi,

I need to filter a combobox based on the value of a check box.
I explain.

I have a checkbox that will start unchecked (value 0).
And below is a combobox that will use an api to fetch the data.
If the user selects this checkbox, the data from the combobox must be updated.

Very similar to this example: https://demos.telerik.com/aspnet-core/combobox/cascadingcombobox
But using the checkbox.

Can someone help me?
I am using ASP.NET MVC Core.

 

Eyup
Telerik team
 answered on 06 Oct 2018
3 answers
436 views
http://demos.telerik.com/kendo-ui/grid/aggregates

here i see an example for grid grouping. Now I want to sort the groups by the aggregate count.  I search the help document and only find sorting settings like "dir: 'desc'", which can only sort groups by field value, not the count of group elements. 

Can someone tell me how to set the configuration to make grid groups sorted by element count?
Viktor Tachev
Telerik team
 answered on 05 Oct 2018
2 answers
663 views

I have an old application where the user was entering an input a dropdown list (of multiple values concatenated) was displayed and he could filter the list based on the values displayed.

Now we decided to use Combobox since the Autocomplete does not open the dropdown when the autocomplete receives focus. Since the list contains too many values I though I should try also virtualization

@(Html.Kendo().ComboBox()
   .Name("deviceclassselection")
   .HtmlAttributes(new { @class = "form-control s-device-class" })
   .DataSource(dataSource => dataSource.Ajax()
                           .Read(read => read.Action("GetDeviceClasses", "Device").Data("device.getDeviceClassAdditionalData"))
                           .PageSize(40)
                           .Events(events => events.Error("device.dataSourceError")))
   .Template("#= data.Designation # - #= data.Manufacturer # - #= data.Model #")
   .Height(200)
   .Events(events => events.Select("device.deviceClassSelect"))
   .Virtual(v => v.ItemHeight(26).MapValueTo("dataItem"))
   .Deferred()
)

However when I write something in the combobox no event is triggered on the server. If I open the dropdown manually the server is called.

I tried removing the Virtual and the result was the same (Probably it did not worked because I left the Ajax and the PageSize).

Dan
Top achievements
Rank 1
Iron
Iron
Veteran
 answered on 05 Oct 2018
1 answer
216 views

Hello all. i'm a newbie for use kendo mvc.

I'll want to know how to programmatically for scheduler mvc ajax on client side .

when i'm single click on date it auto create task and then redirect to another controller.

sorry for my bad english.

thank you very much.

Nencho
Telerik team
 answered on 05 Oct 2018
9 answers
3.6K+ views

I'm using a Kendo Date Picker (2018.1.221.545) on a page like this:

@(Html.Kendo().DatePickerFor(model => model.ClinicBeganDate)
    .Value(Model.ClinicBeganDate.HasValue ? Model.ClinicBeganDate.Value.ToString("MM/dd/yyyy") : "")
)

 

The model for ClinicBeginDate looks like this:

[DataType(DataType.Date)]
[DateRangeYearAgoToToday]
[Display(Name = "Date Clinic Began")]
[Required]
public Nullable<System.DateTime> ClinicBeganDate { get; set; }

 

Note that DateRangeYearAgoToToday is a custom validation attribute.

If I enter a future date and click Save the server side validation works correctly, the form is re-displayed and an error message appears next to the date field. But when I change the invalid date to a valid one (within the past year) and click Save, the form is re-displayed, the date field is blank, and the error message 'Date Clinic Began is required' appears.

After debugging with developer tools I discovered that when Save is clicked the first time with the invalid date, the field is included with the posted form data. The second time Save is clicked it is not. As a result ClinicBeganDate is null the second time and a required validation error results. This happens even though a date is clearly displayed in the field before Save is clicked the second time.

So the problem seems to be the server side validation, but I don't understand why that would prevent a date picker field from getting posted in the form data. Any ideas how to fix this? Obviously I can do the date range validation on the client side but that just hides the problem.

Thanks...

Milena
Telerik team
 answered on 04 Oct 2018
5 answers
177 views

Hi, I have a grid with two frozen columns and numerous columns representing the months of the year starting from the previous year, and extending 5 years into the future.  What I would like to do, is on DataBound, have the column for January of this year be the first column the user sees (in the horizontal scrollable section).  I'm looking for some way to scroll the grid programmatically to a specific column.  Is that possible?  If so how?

 

Thanks,

Mike

Georgi
Telerik team
 answered on 04 Oct 2018
1 answer
869 views

Ok, I'm getting beat to death by a jquery runtime error:

Object doesn't support property or method 'syncReady'

I've checked around, and the most common reason is that there is a extra jquery script reference on my _Layout.cshtml page.

In my case there isn't any other reference to jquery on that page, or as far as I can tell, in my app.

Can you tell me, based on your experience if there is someplace other than _Layout, that may be causing the problem?

I cannot send you one character of the code I'm working on.  My employer would consider this grounds for termination.  I cannot send you a mock-up, either.  I am paid by the hour and they don't look too kindly on me spending time like that.

If you cannot help me without that sort of evidence, I seriously doubt the wisdom behind getting this product of yours in the first place, because quite frankly, I can't get a damned thing in that package to work for me.

 

 

 

Charles
Top achievements
Rank 1
 answered on 03 Oct 2018
3 answers
512 views

Hi,

I'm using the Telerik spreadsheet with MVC wrappers to create an input form and am trying to create a validation error when a cell is empty. I've tried various things along the lines of the below. The obvious way to do this seems to be to set AllowNulls = false but this doesn't behave in the same way that other custom validation does, it immediately adds a red validation check to every null cell with the validation check applied and never triggers the message supplied in the MessageTemplate. If setting AllowNulls(true) then it seems like the custom validation rule doesn't trigger on empty cells, so it seems like I can use the custom validator to check for anything other than a cell being empty. 

cells.Add()
                          .Validation(validation => validation
                            .DataType("custom")
                            .From("LEN(B" + currentRowNo + ") > 0")
                            .AllowNulls(false)
                            .Type("reject")
                            .TitleTemplate("A Provider Name is Required")
                            .MessageTemplate("Please enter a Provider Name"));

 

Regards

Michael

Veselin Tsvetanov
Telerik team
 answered on 03 Oct 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?