Telerik Forums
UI for ASP.NET MVC Forum
4 answers
417 views

Hello,

I load the following via ajax and the shown  javascript Alert fires proving jquery and javascript are working.  Editor Events work but I need to clear the editor contents programmatically.   At the console, well after all loaded and completed, $("#editor") is undefined.  I am looking at this documentation.  http://docs.telerik.com/kendo-ui/aspnet-mvc/helpers/editor/overview#existing-instances

 

 <div id="editorWrapper">
            @(Html.Kendo().Editor()
            .Name("editor")
            .HtmlAttributes(new { @class = "desc-editor", name = "Description", id = "Description" })
            .Resizable(resizable => resizable.Content(true).Toolbar(true))
            .StyleSheets(css => css
            .Add(Url.Content("~/Content/editorStyles.css"))
            )
            .Tools(tools => tools
            .Clear()
            .Bold().Italic().Underline().Strikethrough()
            ).Events(events => events
            .Change("change")
            .Execute("execute")
            .Select("select")
            .Paste("paste")
            ).Value(@<text> </text>)
            )

            <script>
            $(function () {
                alert($(".input-field").length);

                //Notice that the Name() of the Editor is used to get its client-side instance.
                var editor = $("#editor").data("kendoEditor");
            });
            </script>

        </div>

John
Top achievements
Rank 1
 answered on 05 Oct 2016
2 answers
311 views

I was working on the grid persistence with getOptions and setOptions. I believe I was able to get it to work successfully, but I noticed something on one of filters. 

 

My grid has a dropdown selection, like in the 'Grid / Filter menu customization' demo. After the setOptions is called, the filter dropdown is blank.

 

We use the asp.net mvc version, but I was able to reproduce this error in the browser using the javascript console on both the asp.net mvc and the kendo ui versions of the 'Grid / Filter menu customization' demo (which has a filter dropdown on the City column).

 

In my above test of the 'Grid / Filter menu customization' demo, I saw the City filter dropdown go blank after setOptions is called. You are no longer able to select from a dropdown of cities.

 

Any input would be appreciated!

 

 

Marv
Top achievements
Rank 1
 answered on 05 Oct 2016
9 answers
250 views


.Pageable(pager => pager.Enabled(true).PreviousNext(true).PageSizes(new Int32[] {10, 20, 50, 100}))

I just downloaded the latest version of the js files and the Kendo.Mvc.dll

If I remove PageSizes I don't get an error. Any clues?

==========================================================================================

Also, when I add .DataSource binding paging stops working entirely

        @(Html.Kendo().Grid(Model.AppointmentList).Name("FailedAppointments")
                .Columns(columns =>
                {
                    columns.Bound(o => o.MemberFirstName).Title("Member First").Width(70);
                    columns.Bound(o => o.MemberLastName).Title("Member Last").Width(80);
                    columns.Bound(o => o.ClientMemberID).Title("Client ID").Width(60);
                    columns.Bound(o => o.ProviderID).Title("Provider ID").Width(60);
                    columns.Bound(o => o.ProviderFirstName).Title("Provider First").Width(70);
                    columns.Bound(o => o.ProviderLastName).Title("Provider Last").Width(100);
                    columns.Bound(o => o.AppointmentDate).Title("Appointment Date").Width(200);
                    columns.Bound(o => o.IHAAppointmentID).Hidden(true);
                })
                .Pageable(page => page.Enabled(true))
                .DataSource(source => source.Ajax().Read(read => read.Action("BindFailedAppointments""AppointmentScheduling")))                                                    
               
This is the result:



If I remove the DataSource binding, paging shows but does nothing. What is going on?
Dimiter Madjarov
Telerik team
 answered on 05 Oct 2016
1 answer
1.0K+ views

We have AutoComplete working in MVC with this in the view:

@(Html.Kendo().AutoComplete()
.Name("ContentTagsAddt")
.DataTextField("TagName")
.HtmlAttributes(new { style = "width:700px" })
.Placeholder("Begin Typeing Additional Tags...")
.MinLength(3)
.Filter("startswith")
.Separator(", ")
.Value(Model.AdditionalContentTags)
.DataSource(source => source
    .Custom()
    .Group(g => g.Add("TagGroup", typeof(string)))
    .Type("aspnetmvc-ajax")
    .ServerFiltering(true)
    .ServerPaging(true)
    .PageSize(20)
    .Transport(transport => transport
        .Read("GetContentTag", "Article")
    )
    .Schema(schema =>
    {
        schema.Data("Data")
            .Total("Total");
    })
)
)

And it's datasource looks like:

public JsonResult GetContentTag([DataSourceRequest] DataSourceRequest request)
{
    var tags = oandpService.GetContentTags();
 
    return Json(tags.ToDataSourceResult(request));
}

The table it's using to populate is pretty small (37 rows). We'd really like to have the ability to show all items on focus. Would that be possible? An added bonus is if the AutoComplete stays open the entire time and as the person types it highlights the suggestions.

Veselin Tsvetanov
Telerik team
 answered on 05 Oct 2016
1 answer
420 views

I'm trying to bind a MultiSelect to a list of strings. How do I write an data-binding expression for DataTextField and DataValueField?

@model List<string>

@Html.Kendo().MultiSelect().BindTo(Model).DataTextField("?").DataValueField("?")

Nikita
Top achievements
Rank 2
Iron
Iron
 answered on 03 Oct 2016
1 answer
292 views

I have a Spreadsheet which already Bind to an object (see below code). I want to open a file (import) and Bind it with my existing binding.

@(Html.Kendo().Spreadsheet()
.Name("spreadsheet")
.Sheetsbar(false)
.Toolbar(x => x.Data(false).Insert(false))
.HtmlAttributes(new { style = "width:100%;" })
.Rows(5000)
.Events(e => e.ExcelImport("ImportProduct"))
.Sheets(sheets =>
{
sheets.Add()
.Name("Product")
.DataSource<MyCompany.DTO.Logistics.Planning.ProductSearchResultDTO>(ds => ds
.Ajax()
.Batch(true)
.Read(r => r.Action("ProductBulkSearchResults", "Logistics").Data("getCriteria"))
.Update(u => u.Action("ProductBulkUpdate", "Logistics").Data("getCriteria"))
.Events(e => e.Change("onChange"))
.Model(m =>
{
m.Id(p => new { p.ProductID, p.ORGID });
})
)
.Columns(columns =>
{
columns.Add().Width(100);
columns.Add().Width(415);
columns.Add().Width(0);
columns.Add().Width(0);
columns.Add().Width(145);
})
;
})
)

Ivan Danchev
Telerik team
 answered on 03 Oct 2016
3 answers
421 views

I am using a Grid having a date picker in one of the column, when the date picker is displayed in the edit mode, the date is in "dd/MM/YYYY" format so when i select a date in it displays in "dd/MM/YYYY" format but when i update with a date say 29/09/2016 i get invalid date validation error from the control, and if i change it to say 09/209/2016 it works, so the validation it does is for "MM/dd/YYYY" format.  I have not added any custom validation for this, is there there any place that i need to handle this that i am doing it wrong?

 

columns.Bound(p => p.MyDate).Title("Date").EditorTemplateName("Date").Format("{0:dddd dd MMMM yyyy}").Filterable(false).Width(160);
Viktor Tachev
Telerik team
 answered on 03 Oct 2016
7 answers
399 views

Hello,

I have the next problem.I have a grid that has some columns. One of them is called 'ConfirmedValue'. I know that you use '#' to access a parent grid column in a column's clienttemplate in its subgrid-childgrid (detail template). In a clienttemplate in that subgrid I try to format that column value using:

columns.Template(e => { }).ClientTemplate("# if(ConfirmedValue) { # #= kendo.toString(ConfirmedValue, 'c3') # # } #");

But it is not working. In my browsers dev tool console I get the error "Uncaught Error: Invalid template". I assume the sintax I use is OK. When I use it in my parent grid (main grid) it works well without any problems.

I am not sure if this is a bug or if kendo does not support this kind of behaviour. 

Can you please help me out? What did I do wrong?

Best regards,

 

 

 

 

 

Shoeb
Top achievements
Rank 1
 answered on 30 Sep 2016
1 answer
236 views
     When I'm implementing custom binding on the server side for a grid using and ajax data source, is there a way to only implement custom logic for grouping, but allow paging and sorting to be handled automatically the way they normally are when you call ToDataSourceResult on an IQueryable?
Viktor Tachev
Telerik team
 answered on 30 Sep 2016
2 answers
522 views
Is there a way to display the Telerik ASP.Net MediaPlayer control in an MVC page or any other ideas to play a sound clip (.mp3) or video clip?

Thanks
Eyup
Telerik team
 answered on 30 Sep 2016
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
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
DropDownButton
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
+? more
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?