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

My grid shows only 1 page of data until I apply a filter and then clear it. Having done that, it instantly shows all 28 pages.

 

1. does anyone have any idea what might be causing this?

 

2. is there any way to get it to recalculate the page list at the bottom of the grid after loading using a javascript command?

 

Here is the grid:

 

    @(Html.Kendo().Grid<tpnconnect.com.AdminService.DeviceDataEdit>()
        .Name("deviceGrid")
        .Columns(columns =>
        {
            columns.Bound(d => d.DepotNumber).Width(60);
            columns.Bound(d => d.DeviceName).Width(150);
            columns.Bound(d => d.DeviceAlias).Width(150);
            columns.Bound(d => d.AutoMode).Width(100).Title("Auto Mode").EditorTemplateName("AutoMode").ClientTemplate("#:AutoModeDisplay#");
            columns.Bound(d => d.CreatedDate).Title("Created").Format("{0:dd-MMM-yy HH:mm}").Width(80);
            columns.Bound(d => d.Active).Width(40).Filterable(true);
            columns.Command(command => { command.Edit(); command.Destroy(); }).Width(160);
        })
        .ToolBar(toolbar => toolbar.Create())
        .Editable(editable => editable.Mode(GridEditMode.InLine))
        .Pageable()
        .Sortable()
        .Filterable()
        .Scrollable()
        .HtmlAttributes(new { style = "height:430px;" })
        .DataSource(dataSource => dataSource
            .Ajax()
            .Model(model => model.Id(d => d.DeviceID))
            .PageSize(20)
            .ServerOperation(false)
            .Events(events => events.Error("error_handler"))
            .Create(update => update.Action("AddDevice", "Printer"))
            .Read(read => read.Action("GetAllDevicesForEdit", "Printer"))
            .Update(update => update.Action("UpdateDevice", "Printer"))
            .Destroy(update => update.Action("DeleteDevice", "Printer"))
        )
    )

Graham
Top achievements
Rank 2
Iron
Iron
 answered on 21 Jul 2016
1 answer
109 views

Hi,

I have a chart,

Purpose of the chart will say total of male & female, based on the country & nationality wise. Successfully generate the chart
Here is the fiddle, i created.
jsFiddle example

  For the reference
How to categories the series label.

I am trying to position the series name similar like this (Capture.JPG)..

Suggest me how can i generate

 

@(Html.Kendo().Chart()
    .Name("chart")
    .Title("Gender Summay based on the total")
    .Legend(legend => legend
        .Position(ChartLegendPosition.Bottom)
    )
    .Series(series =>
    {
        series.Column(new double[] { 54, 5 }).Name("2010 Bah")
         .Labels(labels =>
        labels.Template("#= series.name #")          
        .Background("transparent")
        .Visible(true));
        series.Column(new double[] { 24, 21 }).Name("2010 Non Bah").Labels(labels =>
       labels.Template("#= series.name #")
       .Background("transparent")
       .Visible(true));
 
        series.Column(new double[] { 54, 5 }).Name("2011 Bah").Labels(labels =>
       labels.Template("#= series.name #")
       .Background("transparent")
       .Visible(true));
 
        series.Column(new double[] { 24, 21 }).Name("2011 Non Bah")
         .Labels(labels =>
        labels.Template("#= series.name #")           
        .Background("transparent")
        .Visible(true));
 
        series.Column(new double[] { 10, 52 }).Name("2012 Bah")
        .Labels(labels =>
       labels.Template("#= series.name #")
       .Background("transparent")
       .Visible(true));
 
        series.Column(new double[] { 12, 65 }).Name("2012 Non Bah")
        .Labels(labels =>
        labels.Template("#= series.name #")
        .Background("transparent")
        .Visible(true));
    })
    .CategoryAxis(axis => axis
        .Categories("Male", "FeMale")
 
        .Justify(true)
    )
 
    .Tooltip(tooltip => tooltip
        .Visible(true)
        .Format("{0}")
        .Template("#= series.name # : #= value #")
    )
    )

Iliana Dyankova
Telerik team
 answered on 21 Jul 2016
1 answer
331 views

I have a requirement where the user needs to be able to Clone or Add & Clone lots and lots of records from within the modal Kendo window. Currently, there are only two buttons at the bottom of the window: Update and Cancel. I've looked all over the web and the support area here, but cannot find any example or docs on how to accomplish adding custom actions and buttons within the modal Kendo window.

  • The user wants to be able to fill out a new form, click Add & Clone, update the current form that has nearly identical values, then click Add & Clone again, etc. etc.
  • The user wants to be able to open an existing form, click Clone, update the current form that has nearly identical values, then click Add & Clone again, etc. etc.

As you can see, the basic scenario is pretty straightforward and very handy for working with lots of similar data. The form should NOT close, but stay open after the submit occurs.

How can I achieve this functionality within a modal Kendo window control (using the toolbar)?

Thanks.

Danail Vasilev
Telerik team
 answered on 20 Jul 2016
4 answers
260 views

Hello,

I created a custom editor for my Scheduler, and I now need to add some custom validation.
My goal is to ensure that:

1) The start and end date must be in the same day (cannot spawn multiple days)
2) The smaller possible unit is 15 min. So the valid hours are xx:00, xx:15, xx:30 and xx:45.

A valid Input would for example be:
from 01.01.2000 11:15
to 01.01.2000 22:45

Invalid examples would be:
from 01.01.2000 11:15
to 02.01.2000 08:45 (not the same day)

from 01.01.2000 11:23 (not multiple of 15min)
to 01.01.2000 14:30

How can I achieve this behavior?
Cheers

AKROS
Top achievements
Rank 1
 answered on 20 Jul 2016
1 answer
108 views

Hi there,

Were using a custom filter for statuses.

Its working fine when were only using this in the grid properties:

 

1.//Column code in grid
2. 
3.columns.Bound(la => la.StatusName)
4..Filterable(s => s.Multi(true).DataSource(ds => ds.Read(r => r.Action("GetStatuses", "Status").Data("{ field: 'StatusName' }"))))
5. 
6.//Grid propert
7..Filterable(ftb => ftb.Mode(GridFilterMode.Menu))

 

but when i add the .ColumnMenu() property to the grid the filtering on the status column doesnt show at all. I need the show/hide column functions in the columnmenu but cant sacrifice the custom status filter.

 

The serverside code for the datasource looks like this:

 

01.public ActionResult GetStatuses(string field)
02.{
03.    var statuses = Context.GetAll<Status>(false);
04. 
05.    var viewModels = (from s in statuses
06.                      select new StatusVm() { StatusName = s.Key })
07.        .ToList();
08. 
09.    return Json(viewModels, JsonRequestBehavior.AllowGet);
10.}

 

Am i missing something obvious here?

 

Thankful for any input.

 

 

Konstantin Dikov
Telerik team
 answered on 20 Jul 2016
1 answer
2.9K+ views

Help here, the checked value of Kendo Checkbox does not change and is always assigned as 'true'. Below is the sample code:

@(Html.Kendo().CheckBox().Name("autoValidate")
    .Checked(false)
    .Label("Auto-Validate")
    .HtmlAttributes(new { onchange = "updateMsg();" })
)
 
<blockquote>
    autoValidate checked value: <span id="autoValidate-value"></span>
</blockquote>
 
<script type="text/javascript">
    function updateMsg() {
        $('#autoValidate-value').text($('input[name=autoValidate]').val());
    }
 
    updateMsg();
</script>

Vessy
Telerik team
 answered on 18 Jul 2016
5 answers
119 views

Hello,

We are currently trying to implement a form containing a datagrid using this tutorial : http://www.kendoui.com/code-library/mvc/grid/submit-form-containing-grid-along-with-other-input-elements.aspx.

So far, we managed to configure the grid but we are facing a major drawback using IE8 which is the browser we are targeting. Actually, insertion and deletion of lines work flawlessly but we can edit the data only once right after creation. However, this doesn’t happen using Google Chrome, so we wanted to know if it was a known bug and if there is a workaround to make it work under IE8.

Thanks in advance,

Yours sincerely,

Kostadin
Telerik team
 answered on 18 Jul 2016
2 answers
708 views

I have a number of options on the page for users to choose which resources they want to load on the scheduler. On scheduler load I make a call to load the resources that they have previously save but I'm not able to manipulate or change them once the page loads. Here is my configuration. 

@(Html.Kendo().Scheduler<Avianis.Models.Scheduler.AppointmentViewModel>()
        .Name("scheduler")
        .Date(new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day))
        .AutoBind(false)
        .Snap(true)
        .Timezone("UTC")
        .Events(e =>
        {
            e.Navigate("scheduler_navigate");
        })
        .Views(views =>
        {   
            views.TimelineView(timeline => timeline
                .Title("Day")
                .MajorTick(60)
                .MinorTickCount(1)
                .EventHeight(77)
                .ColumnWidth(150)
                .EventTemplateId("more-template")
            );
            views.CustomView("TimelineViewFiveDays");
            views.CustomView("TimelineViewSevenDays");
            views.CustomView("TimelineViewThirtyDays");
            views.MonthView(timeline => timeline
                .EventHeight(40)
            );
        })
        .EventTemplateId("event-template")
        .Group(group => group.Resources("Aircraft").Orientation(SchedulerGroupOrientation.Vertical))
        .Resources(resource => resource.Add(m => m.ResourceID)
            .Name("Aircraft")
            .Title("Aircraft")            
            .DataValueField("id")
            .DataTextField("text")
            .DataSource(source => source.Read("GetResources", "Calendar"))
        )
        .Editable(editable => editable
            .Update(false)
            .Create(false)
            .Destroy(false)
            .Move(false)
            .Resize(false)
        )
        .DataSource(dataSource => dataSource            
            .SignalR()
            .Transport(tr => tr                
                .Promise("hubStart")
                .Hub("calendarHub")
                .Server(s => s
                    .Read("LoadAircraft"))
            )
            .Schema(schema => schema
                .Model(model =>
                {
                    model.Id(m => m.ID);
                    model.Field(m => m.ID).Editable(false);
                    model.Field("start", typeof(DateTime)).From("Start");
                    model.Field("end", typeof(DateTime)).From("End");
                    model.Field("title", typeof(string)).From("Subject");
                    model.Field("description", typeof(string)).From("Description");
                    model.Field("isAllDay", typeof(bool)).From("IsAllDay");
                    model.Field("ownerId", typeof(string)).From("OwnerId");
                })
            )
        )
    )

 

I've trying to change resources by saving the selected resources to the database then calling the line below. 

$('#scheduler').data().kendoScheduler.resources[0].dataSource.read();

 

And I've tried it this way as well. 

var scheduler = $("#scheduler").data("kendoScheduler");
scheduler.resources[0].dataSource.data(data);
scheduler.view(scheduler.view().name);

 

Both ways do not refresh the UI. Any help would be appreciated. 

 

 

Yoichi
Top achievements
Rank 1
 answered on 18 Jul 2016
1 answer
461 views

I am using the paste cleanup feature with version 2016.2.504 


I am getting error.
Kendo.MVC.UI.Fluent.EditorBuilder' does not contain a definition for 'PasteCleanup' and no extension method 'PasteCleanup' accepting a first argument of type 'kendo.MVC.UI.Fluent.EditorBuilder' could be found.


Could you please help in this?

 

Just to add more details to above query -


Here is my kendo editor definition like tbelow:


@(Html.Kendo().Editor()
            .Name("ManuscriptFormTextEditor")
             .PasteCleanup(p => p
                    .All(false)
                    .Css(false)
                    .KeepNewLines(false)
                    .MsAllFormatting(false)
                    .MsConvertLists(true)
                    .MsTags(true)
                    .None(false)
                    .Span(false)
                 )                 
            .Tools(tools => tools
                  .Clear()                
                  .Bold().Italic().Underline().Strikethrough()
                  .JustifyLeft().JustifyCenter().JustifyRight().JustifyFull()
                  .InsertUnorderedList().InsertOrderedList()
                  .Outdent().Indent()
                  //.CreateLink().Unlink()
                  //.InsertImage()
                  //.InsertFile()
                  .SubScript()
                  .SuperScript()
                  .TableEditing()
                  //.ViewHtml()
                  .Formatting()
                  .CleanFormatting()
                  //.FontName()
                  .FontName(items => items
                            .Add("Arial", "Arial")
                            .Add("Arial Narrow", "Arial Narrow")
                            .Add("Calibri", "Calibri")
                            .Add("Courier New", "Courier New")
                            .Add("Tahoma", "Tahoma")
                            .Add("Times New Roman", "Times New Roman")
                            .Add("Verdana", "Verdana")                                                        
                            )
                  //.FontSize()
                  .FontSize()
                  .FontColor().BackColor()
                  //.Print()
              )
              .HtmlAttributes(new { style = "width: 100%;height:500px;text-align:center;font-size:14px;" })
              .Encode(false)
              .Value(@<text>@Html.Raw(@ViewBag.ManuscriptFormText)</text>)
    )     


It is not throwing any error if i remove the code :
 .PasteCleanup(p => p
                    .All(false)
                    .Css(false)
                    .KeepNewLines(false)
                    .MsAllFormatting(false)
                    .MsConvertLists(true)
                    .MsTags(true)
                    .None(false)
                    .Span(false)
                 )

Stanimir
Telerik team
 answered on 18 Jul 2016
18 answers
4.2K+ views

Hi there, is there a way to bind Kendo MVC grid to dynamic object (or ExpandoObject)?
hkdave95
Top achievements
Rank 2
Iron
 answered on 15 Jul 2016
Narrow your results
Selected tags
Tags
Grid
General Discussions
Scheduler
DropDownList
Chart
Editor
TreeView
DatePicker
Upload
ComboBox
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
MultiColumnComboBox
Dialog
DropDownTree
Checkbox
Slider
Switch
Notification
ListView (Mobile)
Pager
Accessibility
ColorPicker
DateRangePicker
Wizard
Security
Styling
Chat
MediaPlayer
TileLayout
DateInput
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
+? more
Top users last month
Top achievements
Rank 1
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ivory
Top achievements
Rank 1
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
YF
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Top achievements
Rank 1
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ivory
Top achievements
Rank 1
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
YF
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?