Telerik Forums
UI for ASP.NET MVC Forum
2 answers
196 views
I have an MVC KendoGrid with a custom popup editor that contains 3 select lists using razor DropDownListFor html helpers.  I am using the optionLabel parameter on the helper to show "-- Select One --" empty option when creating a new record, but it is not being selected for 2 selects that have integer values. The other select that has a string type for value in the model is showing the "-- Select One --" corrrectly.  Is there something I can do to have it selected in all 3 dropdown lists for new records?
Pavlina
Telerik team
 answered on 31 Mar 2017
2 answers
2.1K+ views
Is there any way to have a loading indicator on the MVC Chart?  I've seen plenty of examples on how to do that in the JS Chart but none on the MVC Chart.  I have some charts with a lot of data that are taking 15-20 seconds to display so the user is sitting there wondering if the chart is even working.
John
Top achievements
Rank 1
 answered on 31 Mar 2017
1 answer
111 views
is there a way to have different colors for DataPoints on the line series yet?
my need is when value < 3 = green; value >3 and < 6  = yellow; value > 6 = red on a line series
Marin Bratanov
Telerik team
 answered on 31 Mar 2017
2 answers
113 views

Hi; 

It's possible to set a Shared DataSource lto a Fluent API Scheduler, like to a Grid, via DataSource Name?

Example:

DataSource:

@(Html.Kendo().DataSource<Models.Event>()
        .Name("SharedEvents")
         
        .SignalR(sr => sr
         
        .Transport(tr => tr
            .Promise("hubStart")
            .Hub("OpsToolHub")
            .Client(c => c
                .Read("read")
                .Create("create")
                .Update("update")
                .Destroy("destroy"))
            .Server(s => s
                .Read("read")
                .Create("create")
                .Update("update")
                .Destroy("destroy")))
        .Schema(schema => schema
 
            .Model(model => {
                model.Id(m => m.id);
                model.Field(m => m.fID).Editable(false);
                model.Field("start", typeof (DateTime)).From("Start");
                model.Field("end", typeof (DateTime)).From("End");
                model.Field("title", typeof (string)).From("Title");
                model.Field("description", typeof (string)).From("Description").Editable(true);
                model.Field("recurrenceRule", typeof (string)).From("RecurrenceRule");
                model.Field("recurrenceException", typeof (string)).From("RecurrenceException");
                model.Field("isAllDay", typeof (bool)).From("IsAllDay").Editable(true);
                model.Field("startTimezone", typeof (string)).From("StartTimezone").Editable(true);
                model.Field("endTimezone", typeof (string)).From("EndTimezone").Editable(true);
            })
        )
    )
)

 

Scheduler:

01.@(Html.Kendo().Scheduler<Models.Event>()
02.    .Name("schedulerWeek")
03.    .Date(DateTime.Now)
04.    .StartTime(new DateTime(2017, 1, 1, 1, 00, 00))
05.    .Height(1000)
06.    .AllDaySlot(false)
07.    .Timezone("Etc/UTC")
08.    .MajorTick(1440)     
09.    .MinorTickCount(1)   
10.    .CurrentTimeMarker(marker =>
11.    {
12.        marker.UpdateInterval(600000); //updates each 10min.
13.        marker.UseLocalTimezone(false);
14.    })
15.    .Views(views =>
16.    {  
17.        views.CustomView("kendo.ui.SchedulerTimelineWeekView", t =>
18.        {   t.Title("schedulerWeek");           
19.        });       
20.    })
21.    .Resources(resource =>
22.    {
23.        resource.Add(m => m.type)
24.       (...) //shorttened
25.    .Group(group => group.Resources("RegisterName", "type").Orientation(SchedulerGroupOrientation.Vertical))
26.    .EventTemplateId("event-template")
27.    .DataSource(????)  '???? how to set the shared datasource, imposible via name as far as we try!!!

 

Waiting for response;

Best Regards;

Plamen
Telerik team
 answered on 31 Mar 2017
2 answers
121 views

@(Html.Kendo().Grid<intranet.mvc5b.Models.Arrangement.Lokaler>()
            .Name("gridLokaler")
            .Columns(col =>
            {
                col.Bound(p => p.ID).Hidden(true);
                col.Bound(p => p.Lokale);
                col.Bound(p => p.Aktiv).Width(60).ClientTemplate("#=Aktiv? 'Ja' : 'Nej' #");
                col.Command(command => { command.Edit()
                    .Text("Ret")
                    .UpdateText("Gem")
                    .CancelText("Afbryd");
                }).Width(90);
            })
            .ToolBar(toolbar => toolbar.Create().Text("Opret lokale"))
            .Editable(editable => editable.Mode(GridEditMode.PopUp).TemplateName("arrLokaleEdit"))
            .Pageable()
            .DataSource(dataSource => dataSource
                .Ajax()
                .ServerOperation(false)
                .PageSize(15)
                .Events(events => events.Error("error_handler"))
                .Model(model => model.Id(p => p.ID))
                .Update("Lokaler_Update", "Arrangement")
                .Create("Lokale_Opret", "Arrangement")
                .Read("Lokale_Read", "Arrangement")
            )
            .Deferred()
        )

This grid shows ok, but when I edit a row and save without making any changes

it calls the create action insted of update

Im using 2017.1.223.545

Christian Sandöy
Top achievements
Rank 2
 answered on 30 Mar 2017
3 answers
606 views

Hi,

Is it possible to have custom command button in TreeList?

I have tried to configure custom command button in Html.Kendo().TreeList as following:

                        @(Html.Kendo().TreeList<ABM.Models.AzureTreeViewData>()
                                .Name("ddlSubs")
                                .Columns(columns =>
                                {
                                    columns.Add().Field(e => e.Name).Width(480).TemplateId("node-template");
                                    columns.Add().Field(e => e.Type).Hidden(true);
                                    columns.Add().Field(e => e.SubID).Hidden(true);
                                    columns.Add().Command(command =>
                                    {
                                        command.Custom().Text(" ").Name("buttonCustom").Click("showDetails").ImageClass("fa fa-eye fa-lg");
                                    });
                                })
                                .Filterable()
                                .Sortable()
                                .Selectable(true)
                                .DataSource(dataSource => dataSource
                                    .Read(read => read.Action("TreeData", "Main").Data("subsdata"))
                                    .ServerOperation(true)
                                    .Model(m =>
                                    {
                                        m.Id(f => f.Id);
                                        m.ParentId(f => f.ParentId);
                                        m.Expanded(true);
                                        m.Field(f => f.Name);
                                        m.Field(f => f.Icon);
                                        m.Field(f => f.Type);
                                        m.Field(f => f.SubID);
                                    })
                                )
                        .Height(540)
                        )
<script>
    function showDetails(e) {
        e.preventDefault();

        var dataItem = $("#ddlSubs").dataItem($(e.currentTarget).closest("tr"));
 
        var wnd = $("#Details").data("kendoWindow");

        wnd.content(detailsTemplate(dataItem));
        wnd.center().open();
    }
</script>

Unfortunately Click event never hit in my code.

Could you please help me.

Thank you.

 

 

 

Tsvetina
Telerik team
 answered on 30 Mar 2017
1 answer
126 views
I have created a dojo http://dojo.telerik.com/IkaQa with an example spreadsheet that is full size (no scrollbars) that is larger than the screen. If you scroll down to the bottom of the spreadsheet using the window (document) scroll and then select a cell (row 200) it will jump to the top of the window. This only happens in Firefox, IE and Edge, works correctly in chrome. I am currently using a spreadsheet in this fashion in a product. I have been able to add event listeners and override this issue in IE and Edge but for some reason the click event in firefox registers as a double click only. This is a big issue for me and I will open a ticket if need be, any help would be appreciated.
Veselin Tsvetanov
Telerik team
 answered on 30 Mar 2017
1 answer
867 views

Hi,

the Scenario goes as follows - user fills out a form and submits it. The data from the form is merged with a word document template. I want to show the user the completed document. 

here is code snippet  -> return new Result { CoverSheet = memoryStream.ToArray() };

I'm stuck on how to view the document here is my razorview:

I'm stuck on how to render the coversheet. I have tried TelerikReporting and am currently looking at @(Html.Kendo().Editor()...

I see examples for how to use Import to open a word document but now how to create a view with existing data. Any help with how to proceed would be appreciated.

 

 

Ianko
Telerik team
 answered on 30 Mar 2017
6 answers
186 views

Hi!

Is there a way to set the BaseUnit to Milliseconds.

I have to view a sine curve with max. 5Hz like this:

var oscillatorChartData = new kendo.data.ObservableArray(
        [{"T":"\/Date(1490195633551)\/","Val":0.48},{"T":"\/Date(1490195633571)\/","Val":1.45},{"T":"\/Date(1490195633591)\/","Val":2.34},{"T":"\/Date(1490195633611)\/","Val":3.07},{"T":"\/Date(1490195633631)\/","Val":3.61},{"T":"\/Date(1490195633651)\/","Val":3.93},{"T":"\/Date(1490195633671)\/","Val":3.99},{"T":"\/Date(1490195633691)\/","Val":3.81},{"T":"\/Date(1490195633711)\/","Val":3.39},{"T":"\/Date(1490195633731)\/","Val":2.75},{"T":"\/Date(1490195633751)\/","Val":1.94},{"T":"\/Date(1490195633771)\/","Val":1.01},{"T":"\/Date(1490195633791)\/","Val":0.02},{"T":"\/Date(1490195633811)\/","Val":-0.98},{"T":"\/Date(1490195633831)\/","Val":-1.91},{"T":"\/Date(1490195633851)\/","Val":-2.72},{"T":"\/Date(1490195633871)\/","Val":-3.37},{"T":"\/Date(1490195633891)\/","Val":-3.8},{"T":"\/Date(1490195633911)\/","Val":-3.99},{"T":"\/Date(1490195633931)\/","Val":-3.93},{"T":"\/Date(1490195633961)\/","Val":-3.63},{"T":"\/Date(1490195633971)\/","Val":-3.09},{"T":"\/Date(1490195633991)\/","Val":-2.36},{"T":"\/Date(1490195634011)\/","Val":-1.49},{"T":"\/Date(1490195634031)\/","Val":-0.52},{"T":"\/Date(1490195634051)\/","Val":0.48},{"T":"\/Date(1490195634071)\/","Val":1.46},{"T":"\/Date(1490195634091)\/","Val":2.34},{"T":"\/Date(1490195634111)\/","Val":3.07},{"T":"\/Date(1490195634131)\/","Val":3.61},{"T":"\/Date(1490195634151)\/","Val":3.93},{"T":"\/Date(1490195634171)\/","Val":3.99},{"T":"\/Date(1490195634191)\/","Val":3.81},{"T":"\/Date(1490195634211)\/","Val":3.39},{"T":"\/Date(1490195634241)\/","Val":2.75},{"T":"\/Date(1490195634251)\/","Val":1.94},{"T":"\/Date(1490195634271)\/","Val":1.01},{"T":"\/Date(1490195634291)\/","Val":0.01},{"T":"\/Date(1490195634311)\/","Val":-0.98},{"T":"\/Date(1490195634331)\/","Val":-1.91},{"T":"\/Date(1490195634361)\/","Val":-2.73},{"T":"\/Date(1490195634371)\/","Val":-3.37},{"T":"\/Date(1490195634401)\/","Val":-3.8},{"T":"\/Date(1490195634411)\/","Val":-3.99},{"T":"\/Date(1490195634431)\/","Val":-3.93},{"T":"\/Date(1490195634451)\/","Val":-3.63},{"T":"\/Date(1490195634471)\/","Val":-3.09},{"T":"\/Date(1490195634491)\/","Val":-2.36},{"T":"\/Date(1490195634511)\/","Val":-1.49},{"T":"\/Date(1490195634531)\/","Val":-0.52},{"T":"\/Date(1490195634551)\/","Val":0.49},{"T":"\/Date(1490195634571)\/","Val":1.46},{"T":"\/Date(1490195634601)\/","Val":2.34},{"T":"\/Date(1490195634611)\/","Val":3.07},{"T":"\/Date(1490195634631)\/","Val":3.62},{"T":"\/Date(1490195634651)\/","Val":3.93},{"T":"\/Date(1490195634681)\/","Val":3.99},{"T":"\/Date(1490195634691)\/","Val":3.81},{"T":"\/Date(1490195634711)\/","Val":3.38},{"T":"\/Date(1490195634731)\/","Val":2.75},{"T":"\/Date(1490195634751)\/","Val":1.94},{"T":"\/Date(1490195634771)\/","Val":1.01},{"T":"\/Date(1490195634791)\/","Val":0.01},{"T":"\/Date(1490195634811)\/","Val":-0.98},{"T":"\/Date(1490195634841)\/","Val":-1.92},{"T":"\/Date(1490195634851)\/","Val":-2.73},{"T":"\/Date(1490195634871)\/","Val":-3.37},{"T":"\/Date(1490195634891)\/","Val":-3.8},{"T":"\/Date(1490195634911)\/","Val":-3.99},{"T":"\/Date(1490195634941)\/","Val":-3.93},{"T":"\/Date(1490195634951)\/","Val":-3.62},{"T":"\/Date(1490195634981)\/","Val":-3.09},{"T":"\/Date(1490195634991)\/","Val":-2.36},{"T":"\/Date(1490195635011)\/","Val":-1.48},{"T":"\/Date(1490195635031)\/","Val":-0.51},{"T":"\/Date(1490195635051)\/","Val":0.49},{"T":"\/Date(1490195635081)\/","Val":1.47},{"T":"\/Date(1490195635091)\/","Val":2.35},{"T":"\/Date(1490195635111)\/","Val":3.08},{"T":"\/Date(1490195635131)\/","Val":3.61},{"T":"\/Date(1490195635151)\/","Val":3.93},{"T":"\/Date(1490195635171)\/","Val":3.99},{"T":"\/Date(1490195635191)\/","Val":3.81},{"T":"\/Date(1490195635211)\/","Val":3.38},{"T":"\/Date(1490195635231)\/","Val":2.74},{"T":"\/Date(1490195635251)\/","Val":1.94},{"T":"\/Date(1490195635271)\/","Val":1},{"T":"\/Date(1490195635291)\/","Val":0.01},{"T":"\/Date(1490195635311)\/","Val":-0.99},{"T":"\/Date(1490195635331)\/","Val":-1.92},{"T":"\/Date(1490195635351)\/","Val":-2.73},{"T":"\/Date(1490195635371)\/","Val":-3.37},{"T":"\/Date(1490195635391)\/","Val":-3.8},{"T":"\/Date(1490195635411)\/","Val":-3.99},{"T":"\/Date(1490195635431)\/","Val":-3.93},{"T":"\/Date(1490195635451)\/","Val":-3.62},{"T":"\/Date(1490195635471)\/","Val":-3.09},{"T":"\/Date(1490195635491)\/","Val":-2.36},{"T":"\/Date(1490195635511)\/","Val":-1.48},{"T":"\/Date(1490195635531)\/","Val":-0.51},{"T":"\/Date(1490195635551)\/","Val":0.49},{"T":"\/Date(1490195635571)\/","Val":1.46},{"T":"\/Date(1490195635591)\/","Val":2.35},{"T":"\/Date(1490195635611)\/","Val":3.08},{"T":"\/Date(1490195635631)\/","Val":3.62},{"T":"\/Date(1490195635651)\/","Val":3.93},{"T":"\/Date(1490195635671)\/","Val":3.99},{"T":"\/Date(1490195635691)\/","Val":3.81},{"T":"\/Date(1490195635711)\/","Val":3.38},{"T":"\/Date(1490195635731)\/","Val":2.74},{"T":"\/Date(1490195635751)\/","Val":1.93},{"T":"\/Date(1490195635771)\/","Val":1},{"T":"\/Date(1490195635791)\/","Val":0.01},{"T":"\/Date(1490195635811)\/","Val":-0.99},{"T":"\/Date(1490195635831)\/","Val":-1.93},{"T":"\/Date(1490195635851)\/","Val":-2.73},{"T":"\/Date(1490195635871)\/","Val":-3.37},{"T":"\/Date(1490195635891)\/","Val":-3.8},{"T":"\/Date(1490195635911)\/","Val":-3.99},{"T":"\/Date(1490195635931)\/","Val":-3.93},{"T":"\/Date(1490195635951)\/","Val":-3.62},{"T":"\/Date(1490195635971)\/","Val":-3.09},{"T":"\/Date(1490195635991)\/","Val":-2.36},{"T":"\/Date(1490195636011)\/","Val":-1.48},{"T":"\/Date(1490195636031)\/","Val":-0.5},{"T":"\/Date(1490195636051)\/","Val":0.5},{"T":"\/Date(1490195636071)\/","Val":1.47},{"T":"\/Date(1490195636091)\/","Val":2.35},{"T":"\/Date(1490195636111)\/","Val":3.08},{"T":"\/Date(1490195636131)\/","Val":3.62},{"T":"\/Date(1490195636151)\/","Val":3.93},{"T":"\/Date(1490195636171)\/","Val":3.99},{"T":"\/Date(1490195636191)\/","Val":3.81},{"T":"\/Date(1490195636211)\/","Val":3.38},{"T":"\/Date(1490195636240)\/","Val":2.74},{"T":"\/Date(1490195636260)\/","Val":1.93},{"T":"\/Date(1490195636270)\/","Val":1},{"T":"\/Date(1490195636300)\/","Val":0},{"T":"\/Date(1490195636310)\/","Val":-0.99},{"T":"\/Date(1490195636340)\/","Val":-1.92},{"T":"\/Date(1490195636350)\/","Val":-2.74},{"T":"\/Date(1490195636380)\/","Val":-3.38},{"T":"\/Date(1490195636400)\/","Val":-3.8},{"T":"\/Date(1490195636420)\/","Val":-3.99},{"T":"\/Date(1490195636440)\/","Val":-3.93},{"T":"\/Date(1490195636450)\/","Val":-3.62},{"T":"\/Date(1490195636480)\/","Val":-3.08},{"T":"\/Date(1490195636490)\/","Val":-2.35},{"T":"\/Date(1490195636520)\/","Val":-1.47},{"T":"\/Date(1490195636540)\/","Val":-0.5}]
    );

    var oscillatorDataSource = new kendo.data.DataSource({
        data: oscillatorChartData
    });
Stefan
Telerik team
 answered on 29 Mar 2017
3 answers
2.0K+ views

Hi All, 

       How we add dropdownlist as filter in kendo grid and how its populate from enum? Below i providing my code

 

 @(Html.Kendo()
                            .Grid<Portals.Areas.Reports.Models.TransactionReportItem>()
                            .Name("transactionGrid")
                            .HtmlAttributes(new { @class = "grid-primary" })
                            .DataSource(dataSource => dataSource
                                .Ajax()
                                .PageSize(100)
                                .Read(read => read.Action("GetTransactions", "Transactions")))
                            .Pageable(pageable => pageable
                                .Enabled(true)
                                .PageSizes(new[] { 100, 500 })
                                .Refresh(false)
                                .ButtonCount(5))
                            .Columns(columns =>
                            {
                               
                                columns.Bound(row => row.TransactionID);

                                //Order ID Column
                                columns.Bound(row => row.OrderID);

                                //TxnAmount Column
                                columns.Bound(row => row.TransactionAmount).Format("{0:n2}").HeaderHtmlAttributes(new { @class = "text-align-reverse" }).HtmlAttributes(new { @class = "text-align-reverse" });

                                //Txn date column
                                columns.Bound(row => row.TransactionDate).Format("{0:" + userPreference.PreferredDateDisplayFormat + "}").HeaderHtmlAttributes(new { @class = "text-align-reverse" }).HtmlAttributes(new { @class = "text-align-reverse" });

                                //ViewDetail column
                                columns.Bound(row => row.TransactionID).Title("").Filterable(f => f.Enabled(false))
                                .ClientTemplate(@"
                                    <button id='#= TransactionID #' data-btn-viewDetail='#= TransactionID #' class='btn btn-neutral btn-sm'>
                                        View Detail
                                    </button>
                                ");
                            })
                            .Sortable()
                            .Filterable(ftb => ftb.Enabled(true))
                            .ToolBar(tools => tools.Pdf())
                            .ToolBar(tools => tools.Excel())
                            .Pdf(pdf => pdf
                                .AllPages()
                                .PaperSize("A4")
                                .Scale(0.8)
                                .RepeatHeaders()
                                .AvoidLinks()
                                .Landscape()
                                .Title("Title")
                                .TemplateId("page-template")
                                .Margin("2cm", "1cm", "1cm", "1cm")
                                .FileName(string.Format("PayCommerce_Merchant_Transaction_Report_{0}.pdf", DateTime.UtcNow.ToString("yyyymmdd_hhmmss")))
                                .ForceProxy(true)
                                .ProxyURL(Url.Action("Pdf_Export_Save", "Transactions"))
                            )
                            .Excel(excel => excel
                                .AllPages(true)
                                .FileName(string.Format("PayCommerce_Merchant_Transaction_Report_{0}.xlsx", DateTime.UtcNow.ToString("yyyymmdd_hhmmss")))
                                .ForceProxy(true)
                                .ProxyURL(Url.Action("Pdf_Export_Save", "Transactions"))
                            )

                            )

 

 

Tsvetina
Telerik team
 answered on 29 Mar 2017
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
Barcode
ButtonGroup (Mobile)
Drawer (Mobile)
ImageEditor
RadioGroup
Sparkline
Stepper
TabStrip (Mobile)
GridLayout
Template
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
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?