Telerik Forums
UI for ASP.NET MVC Forum
3 answers
145 views
May I know how to do it in MVC? Previously, I have used a custom popup template. Something like javascript code below.

editable: {    mode: "popup",    template: kendo.template($("#popup_editor").html())}
Dimiter Madjarov
Telerik team
 answered on 26 Nov 2014
1 answer
144 views
Hello...

I have a Ajax grid, like that :

@(Html.Kendo().Grid<EmployeeVM>().Name("grid")
  .Columns(columns =>  {
      columns.Bound(model => model.Id).Hidden(true);
      columns.Bound(model => model.First);                              
      columns.Bound(model => model.Email);                          
   })
   .Groupable(y => y.Enabled(true))
   .Sortable(x => x.SortMode(GridSortMode.MultipleColumn))
   .Pageable(x => x.PageSizes(true).Messages(messages => messages.Empty("")))
   .DataSource(dataSource => dataSource
      .Ajax()     
      .PageSize(10)
      .Model(model => model.Id(p => p.Id))
      .Read(read => read.Action("List", "Employee").Type(HttpVerbs.Post)))


The javascript generated included the datasource type 'aspnetmvc-ajax':
...
"dataSource":{"type":(function(){if(kendo.data.transports['aspnetmvc-ajax']){return 'aspnetmvc-ajax';} else{throw new Error('The kendo.aspnetmvc.min.js script is not included.');}})()
...

I dont want that. I´d like to takeoff that type. 
How can I change/takeoff the automatic type generated?

Ty
Daniel
Telerik team
 answered on 26 Nov 2014
3 answers
250 views
Hello,

I have kendo scheduler with adaptive rendering and works fine on android and ios browsers if i edit an event by tapping and then save or cancel and editor closed. the scheduler view refreshes without problem. Problem happens when i have a default eventid and i popup edit window using editEvent in scheduler_databound .
function scheduler_dataBound(e) {      

        var start = kendo.format('{0:d}', this.view().startDate());
        var end = kendo.format('{0:d}', this.view().endDate());
        var rootDir = "@Url.Content("~/")";
        $.ajax({
            url: rootDir + "Scheduler/LoadEventID",
            async: false,
            cache: false,
            timeout: 30000,
            success: function (state) {
               // alert(state);
                if (state) {
                    var eventuid;
                    var model = $("#scheduler").data("kendoScheduler").dataSource;
                    var event = model.get(state);
                    $("#scheduler").data("kendoScheduler").editEvent(event);
                   
                }
            }
        });       
    
    }

Works fine on desktop browsers. On tablet phone browsers this opens the correct event with all details. But when i save or cancel and edit window is gone there is just a gray area. I do not see the scheduler unless i reload page. If i call scheduler read and refresh that does not help

Thanks

Anamika
Georgi Krustev
Telerik team
 answered on 26 Nov 2014
3 answers
156 views
Hi,

I would like to show a different template for the day and the week view of my scheduler. This works correctly when setting the 'AddDayEventTemplate' on the view. However when I change this to use 'AddDayEventTemplateId' (and reference the appropriate script tag) it doesn't show the template and just shows the default event template.

My code is:

<script id="day" type="text/x-kendo-template">
    <p>Day event #=title#</p>
</script>
 
 
<script id="week" type="text/x-kendo-template">
   <p>Week event #=title#</p>
</script>
 
 
@(Html.Kendo().Scheduler<SurveyPortal.Web.ViewModels.ScheduleViewModel>()
    .Name("adminScheduler")
    .Editable(e=>e.Destroy(false).Resize(false))
    .Views(v=>{
        v.DayView(m => m.ShowWorkHours(true).AllDayEventTemplateId("day"));
        v.WeekView(m => m.ShowWorkHours(true).AllDayEventTemplateId("week"));
        v.MonthView(m => m.Selected(true));
    })
    .Resources(r=>{
        r.Add(m => m.ItemType)
            .Title("ItemType")
            .DataValueField("ItemType")
            .DataTextField("Text")
            .ValuePrimitive(false)
            .BindTo(new[] {
                new {Text = "Survey", Value = Model.ScheduleItems},
                new {Text = "Request", Value = Model.ScheduleItems }
            });
    })
    .WorkDayStart(9, 0, 0)
    .WorkDayEnd(18, 0, 0)
    .DateHeaderTemplate("#=kendo.toString(date,'ddd dd/MM')#")
    .MajorTimeHeaderTemplate("#=kendo.toString(date, 'H:mm' )#")
    .BindTo(Model.ScheduleItems)
    .HtmlAttributes(new { @class = "crm_scheduler" })
)

If someone could let me know how to resolve that, it would be much appreciated.

Becky
Alexander Popov
Telerik team
 answered on 26 Nov 2014
3 answers
912 views
Hi Team,

       I have Two Issues..
      1 )     How to Reload whole Gantt  After Insert and Update .. By default it  refresh only inserted  and updated row . I need to update All the rows for some) condition and refresh the gantt after insert and upload.. 
          
      2)    Move,MoveStart, MoveEnd Events are not Triggered while dragging the row..

Thank You ..
Kiril Nikolov
Telerik team
 answered on 26 Nov 2014
5 answers
85 views
I just upgraded from Q2 to Q3 and our grids are all now showing an extra row in the header. Is this a styling issue? I recall something in the change log about multi-row headers, but I didn't expect it would be on by default.

http://screencast.com/t/bpaJ2rJ6l
Dimiter Madjarov
Telerik team
 answered on 26 Nov 2014
2 answers
115 views
Latest build.


I noticed that some grids column resizing no longer works.  It took a while to figure out why some worked and some not.

It seems that if the grid has a .ClientDetailTemplateId() defined - the column resizing no longer works?

Rosen
Telerik team
 answered on 26 Nov 2014
4 answers
511 views

We have multiple Heirachical grids but are having issues when trying to construct routing data that contains Guids. The following Template works fine, the Controller receives the Guid Value (Query String Parameters "ruleId:22222222-2222-2222-2222-222222222222") .The content of the tab being a partial view containing a sub-grid:

<script id="RuleDetailTemplate" type="text/x-kendo-template">
    @(Html.Kendo().TabStrip()
        .Name("detailTabs_#=RuleId#")
        .Items(items =>
        {
            items.Add().Text(Resources.DetailsLabel)
                .Selected(true)
                .LoadContentFrom("RuleDetailsTab", "Administration",
                    new { ruleId = "#=RuleId#" });
...
        }).ToClientTemplate()
    )
</script>

However if we replace the TabStrip with a Splitter the controller receives (Query String Parameters "ruleId:#=RuleId#"):

<script id="RuleDetailTemplate" type="text/x-kendo-template">
        @(Html.Kendo().Splitter()
        .Name("detailsContainer_#=RuleId#")
        .Panes(panes =>
        {
            panes.Add()
               .LoadContentFrom("RuleDetailsTab", "Administration",
                    new { ruleId = "#=RuleId#" });

        }).ToClientTemplate()
    )
</script>

We do not specifically want to use a Splitter in this case as there is only one panel but can not embed the sub grid directly as it will also not allow us to build the Model properties for a create.


Kelly
Top achievements
Rank 1
 answered on 26 Nov 2014
1 answer
236 views
Hello,

Using the Fluent UI cshtml helpers, I am loading a Kendo UI window, using a template. 

The template contains a grid, for which I utilise aggregates; namely the Sum.

When the window is activated on my page, I receive a javascript error "sum is undefined".

Note: the window is loading a grid of child elements to a parent row of data on the main page's grid. (Hierarchy). 

In my investigations,
 - the template loads the grid correctly and functions perfectly if I do not have aggregates

Any ideas guys?

Thanks,
Brendan

---- TEMPLATE ----
** for brevity, I cut out the .Add(), .Destroy() datasource calls

<script id="MaterialTraceItemsAdvancedTemplate" type="text/kendo-tmpl">
    <div id="details-container">
        <h4>#= Description #</h4>


        @(Html.Kendo().Grid<TraceItem>().Name("grid_#=OID#").Columns(columns =>
          {
              columns.Bound(o => o.Cert).Width(70);
              columns.Bound(o => o.Trace).Width(110);
              columns.Bound(o => o.ExpectedQty).Width(110).ClientFooterTemplate("Sum: #=sum#"); 
              columns.Command(command =>
                  {
                      command.Destroy();
                      command.Edit();
                  }).Width(110);
          }).Editable(editable => editable.Mode(GridEditMode.InLine)).ToolBar(toolbar =>
              {
                  toolbar.Create();
              }).DataSource(dataSource => dataSource.Ajax()
                                              .Batch(true)
                                              .Model(model =>
                                                  {
                                                      model.Id(mt => mt.Id);
                                                  })
                                               .Aggregates(aggregates =>
                                                {
                                                    aggregates.Add(p => p.ExpectedQty).Sum();
                                                })
                                              .Read(read => read.Action("MrclItems_TraceItems", "Receiving", new { OID = "#=OID#" }))
                                              .Events(events => events.Error("error_handler"))).Sortable().Scrollable().ToClientTemplate()
        )
    </div>
</script>

------ WINDOW

@(Html.Kendo().Window().Name("MaterialTraceItemsAdvanced")
    .Title("Material Trace")
    .Visible(false)
    .Modal(true)
    .Draggable(true).Width(800))

------ PARENT Grid command snippet

....
columns.Command(command => command.Custom("TraceItems").Click("grid_ShowDetails")).Width(100);
....

------ PARENT Grid invocation javascript
   var materialTraceItemsAdvancedTemplate = kendo.template($("#MaterialTraceItemsAdvancedTemplate").html());
    var dataItem;

    function grid_ShowDetails(e, scope) {
        e.preventDefault();

        dataItem = scope.dataItem($(e.currentTarget).closest("tr"));
        var wnd = $("#MaterialTraceItemsAdvanced").data("kendoWindow");
        wnd.content(materialTraceItemsAdvancedTemplate(dataItem));
        wnd.bind("activate", window_activate);
        wnd.center().open();
    }


    function window_activate() {
        var gridName = "#grid_" + dataItem.OID;
        var grid = $(gridName).getKendoGrid();
         grid.bind("edit", function (e) {
            if (e.model.isNew() && !e.model.dirty) {
                e.container
                  .find("input[name=Cert]") 
                  .val(traceCertTemplate) //variable provided from _MrclItemsGridView
                  .change(); 
                e.container
                  .find("input[name=Trace]") 
                  .val(traceValueTemplate) //variable provided from _MrclItemsGridView
                  .change(); 
            }
         });


       
    }
Nikolay Rusev
Telerik team
 answered on 25 Nov 2014
5 answers
6.9K+ views
I have a grid that's I want to refresh, with the old telerik mvc controls we could use ajaxrequest, but that does not seem to work with kendo grid.
How do I refresh the grid without having to reload the page?

Thanks
Gabriel
Top achievements
Rank 1
 answered on 25 Nov 2014
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
ColorPicker
DateRangePicker
Security
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
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?