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

Hi, 

 I have a grid in my project and it's giving me problems. In local enviroment when I try to update inline everything works perfect

{"Data":[{"Id":51,"IdEvento":50,"Nombre":"asdfa","Descripcion":"sadfasd","Escuela":"dsdaf","HoraInicio":"\/Date(1432243240000)\/","HoraTermino":"\/Date(1432288800000)\/","Lugar":"dasf","Estatus":true,"Cupo":6,"Inscritos":1}],"Total":1,"AggregateResults":null,"Errors":null}

 As you can see the date is correctly set, but when deployd to a Q/A enviroment

{"Data":[{"Id":21,"IdEvento":32,"Nombre":"taller 1","Descripcion":"prueba","Escuela":"Escuela uno","HoraInicio":"\/Date(-62135575200000)\/","HoraTermino":"\/Date(-62135575200000)\/","Lugar":"Lugar uno","Estatus":true,"Cupo":48,"Inscritos":22}],"Total":1,"AggregateResults":null,"Errors":{"HoraInicio":{"errors":["The value \u002701/01/1900 12:30:00 p. m.\u0027 is not valid for HoraInicio."]},"HoraTermino":{"errors":["The value \u002701/01/1900 02:00:00 p. m.\u0027 is not valid for HoraTermino."]}}}

The same escenario now sets the date wrong.

This is the code from my grid:

 

01.@(Html.Kendo().Grid(Model).Name("Grid").Columns(
02.                            columns =>
03.                            {
04.                                columns.Bound(p => p.IdEvento);
05.                                columns.Bound(p => p.Nombre);
06.                                columns.Bound(p => p.Descripcion);
07.                                columns.Bound(p => p.Escuela);
08.                                columns.Bound(p => p.HoraInicio).Width(30).Format("{0: dd/MM/yyyy hh:mm tt}");
09.                                columns.Bound(p => p.HoraTermino).Width(30).Format("{0: dd/MM/yyyy hh:mm tt}");
10.                                columns.Bound(p => p.Lugar);
11.                                columns.Bound(p => p.Estatus);
12.                                columns.Bound(p => p.Cupo);
13.                                columns.Bound(p => p.Inscritos);
14.                                columns.Command(command => { command.Edit(); command.Destroy(); }).Width(172);
15.                            })
16.                            .ToolBar(toolbar =>
17.                                {
18.                                    toolbar.Create();
19.                                })
20.                            .Editable(editable => editable.Mode(GridEditMode.InLine))
21.                            .Pageable()
22.                            .DataSource(dataSource => dataSource
23.                                        .Ajax()
24.                                        .PageSize(20)
25.                                        .Events(events =>
26.                                        {
27.                                            events.Error("error_handler");
28.                                        })
29.                                        .Model(model =>
30.                                            {
31.                                                model.Id(p => p.Id);
32.                                                model.Field(p => p.IdEvento).Editable(false).DefaultValue(idEvento);
33.                                            })
34.                                        .Create(update => update.Action("EditingInline_Create", "EditarTaller"))
35.                                        .Update(update => update.Action("EditingInline_Update", "EditarTaller"))
36.                                        .Destroy(update => update.Action("EditingInline_Destroy", "EditarTaller"))
37.                            )
38.)

 

Any help will be greatly appreciated, thanks in advanced.

Manuel David
Top achievements
Rank 1
 answered on 27 May 2015
1 answer
370 views
In Listview,I used Data method to passing additional parameters : 

.Read(read => read.Action("Products_Read", "ListView").Data("additionalInfo"))

But Mobile Listview not exist  Data menthod like Listview.
Please can you show my how to pass addtional parameter in Mobile Listview(MVC) for Read operation and how to handle it in corresponding Controller?
Boyan Dimitrov
Telerik team
 answered on 27 May 2015
1 answer
306 views

I am using a kendo listview in my project. I have a situation where i need to find out if the listview is in edit mode from jquery on a button click. Unfortunalely i could not find any suitable attribute or property to identify. Please provide me with a suitable solution for the same.

Thanks in advance

Plamen Lazarov
Telerik team
 answered on 27 May 2015
1 answer
986 views

Hi

I have a popup edit template and when I close it I want to refresh the grid.

I used the instructions from here http://www.telerik.com/forums/pop-up-editor-events but there is no Edit event. It doesnt find such an event so I used Deactive. I tried almost all events and none of them will fire my javascript function. Even after I get it to fire I wouldnt know what to use to make the grid to refresh.

Can you please help me what should I use to refresh the grid on popup close. I need to do something like rebind because I need to refresh result from another table and maybe run another javascript function to repaint the rows.

Here is my code:

@using PartnerLink.Models
@using Telerik.OpenAccess.SPI
@model Tuple<TBL_ASSIGNMENT, IQueryable<TBL_ASSIGNMENT_EXPENDITURE_VALUE>, IQueryable<TBL_ASSIGNMENT_INCOME_VALUE>, IQueryable<TBL_ASSIGNMENT_VEHICLE>>
 
<div style="height:500px">
    @(Html.Kendo().Grid<AssignmentDocTypesExt>()
        .Name("gridCaseDocuments")
        .Columns(columns =>
        {
            columns.Bound(p => p.ASSIGNMENT_DOCUMENT_TYPE_ID).Hidden(true);
            columns.Bound(p => p.ASSIGNMENT_ID).Hidden(true);
            columns.Bound(p => p.DOCUMENT_TYPE_ID).Hidden(true);
            columns.Bound(p => p.WHICH_APPLICANT).Hidden(true);
            columns.Bound(p => p.DOCUMENT_TYPE_STATUS_ID).Hidden(true);
            columns.Bound(p => p.CREDITOR_ID).Hidden(true);
            columns.Bound(p => p.numOfUploadedFiles).Title("Files").Width(60);
            columns.Bound(p => p.documentDescription).Title("Document").Width(350);
            columns.Bound(p => p.whichApplicant).Title("Applicant").Width(100);
            columns.Bound(p => p.documentTypeStatusDescription).Title("Type Status").Width(200);          
            columns.Bound(p => p.COMPLETE_FLAG).Title("Complete").ClientTemplate("<input type='checkbox' #= COMPLETE_FLAG ? checked='checked' :'' # disabled />").Width(90);
            columns.Bound(p => p.autoCompleteOnUpload).Title("Auto Complete").ClientTemplate("<input type='checkbox' #= autoCompleteOnUpload ? checked='checked' :'' # disabled />").Hidden(true);      
            columns.Command(command => { command.Edit().Text("Upload"); }).Width(230);
        })
        .Editable(editable => editable.Mode(GridEditMode.PopUp).TemplateName("ClientDocumentUpload").Window(w => w.Events(e => e.Deactivate("onCloseClientDocumentUpload"))))
        .Sortable()
        .Scrollable()
        .ClientDetailTemplateId("gridCaseDocumentsDetails")
        .Pageable(pager => pager.Refresh(true))
        .Resizable(resize => resize.Columns(true))
        .HtmlAttributes(new { style = "height:500px;" })
        .Events(clientEvents => clientEvents.DataBound("onRowDataBoundgridCaseDocuments"))             
        .DataSource(dataSource => dataSource
            .Ajax()
            .PageSize(20)
            .Events(events => events.Error("error_handlerCaseDocuments"))
            .Model(model => model.Id(p => p.ASSIGNMENT_DOCUMENT_TYPE_ID))
            .Read(read => read.Action("CaseDocuments_Read", "Home", new { id = Model.Item1.ASSIGNMENT_ID }))
            .Update(update => update.Action("CaseDocuments_Update", "Home"))           
            )
                       
    )
</div>
 
<script id="gridCaseDocumentsDetails" type="text/kendo-tmpl">
    @(Html.Kendo().Grid<ClientDocumentsExt>()
            .Name("gridCaseDocuments_#=ASSIGNMENT_DOCUMENT_TYPE_ID#")
            .Columns(columns =>
            {
                columns.Bound(m => m.ASSIGNMENT_DOCUMENT_ID).Hidden(true);
                columns.Bound(m => m.FILE_NAME).Title("File Name");
                columns.Bound(m => m.uploadedBy).Title("Uploaded By").Width(210);
                columns.Bound(m => m.DATE_CREATED).Title("Upload Date").Format("{0:dd/MM/yyyy}").Width(110);
                columns.Template(@<text></text>).ClientTemplate("<a class='k-button' href='" +
                                                                        Url.Action("ClientDocs_Download", "Home") +
                                                                        "/\\#= ASSIGNMENT_DOCUMENT_ID \\#'" +
                                                                    ">Download</a>").Width(110);
                columns.Command(c => c.Destroy().Text("Delete")).Width(110);
            })
                    .DataSource(dataSource => dataSource
                        .Ajax()
                        .PageSize(5)
                        .Model(model => model.Id(m => m.ASSIGNMENT_DOCUMENT_ID))
                        .Read(read => read.Action("gridCaseDocumentsDetails_Read", "Home", new { id = "#=ASSIGNMENT_DOCUMENT_TYPE_ID#" }))
                        .Destroy(delete => delete.Action("gridCaseDocumentsDetails_Destroy", "Home"))
 
                    )
                    .Pageable(pager => pager.Refresh(true))
                    .Sortable()
                    .Scrollable()
                    .ToClientTemplate()
    )
</script>
 
<script type="text/javascript">
    function error_handlerCaseDocuments(e) {
        if (e.errors) {
            var message = "Errors:\n";
            $.each(e.errors, function (key, value) {
                if ('errors' in value) {
                    $.each(value.errors, function () {
                        message += this + "\n";
                    });
                }
            });
            alert(message);
        }
    }
 
    $("#gridCaseDocuments").find(".k-grid-content").height(421);
 
    function onRowDataBoundgridCaseDocuments(e) {
 
        var grid = $("#gridCaseDocuments").data("kendoGrid");
        var gridData = grid.dataSource.view();
 
        for (var i = 0; i < gridData.length; i++) {
            var currentUid = gridData[i].uid;
            if (gridData[i].COMPLETE_FLAG) {
                var currenRow = grid.table.find("tr[data-uid='" + currentUid + "']");
                $(currenRow).css("background-color", "#40FF00");
            } else if (gridData[i].numOfUploadedFiles > 0) {
                var currenRow = grid.table.find("tr[data-uid='" + currentUid + "']");
                $(currenRow).css("background-color", "rgb(255,191,0)");
            }
        }
    }
    function onCloseClientDocumentUpload()
    {
        alert("onCloseClientDocumentUpload");
    }
</script>

Boyan Dimitrov
Telerik team
 answered on 26 May 2015
2 answers
390 views

Hi,

I having an issue with the Chart control. All series columns in the chart are Black but the Legend shows each series with a different color.

@(Html.Kendo().Chart<ViolationsChartModel>()
.Name("ViolationsChart")
.Title("Inspection Results By Year")
.DataSource(ds => ds
.Read(read => read.Action("ViolationsReportChart", "Violations"))
.Group(g => g.Add(v => v.InspectionYear))
.Sort(s => s.Add(v => v.Question))
)
.Legend(legend => legend
.Position(ChartLegendPosition.Bottom)
)
.Series(series =>
{
series.Column(value => value.InspectionPercent, category => category.Question).Name("${group.value}").CategoryField("Question");
})
.ValueAxis(axis => axis.Numeric()
.Labels(lables => lables.Format("{0:P0}").Visible(true))
)
.CategoryAxis(axis => axis
.Visible(true)
)
.Tooltip(tooltip => tooltip
.Visible(true)
.Format("{0:P0}")
.Template("${series.name} - ${category} - ${value}")
)

If I add .SeriesColors("#cd1533", "#d43851", "#dc5c71", "#e47f8f", "#eba1ad",...) the Legend shows those colors but chart still shows all series as black.

What am I doing wrong?

Thanks,

 

           

Steven
Top achievements
Rank 1
 answered on 26 May 2015
1 answer
113 views

Hi.

I'm wondering how to make the upload file button still being visible after you have successfully uploaded a file.

Select a file. -> upload button is visible.
Click on upload button and the file is succefully uploaded -> Upload button hidden.

Is there a way to stop the upload button from hiding or showing it again?

Dimiter Madjarov
Telerik team
 answered on 26 May 2015
2 answers
289 views

Hello.

We have an MVC app with some webapi controllers that use custom security based on a header that the request must include.

How can we modify the controls to make them include the headers when they request the data to the server?

As far as we've been seen, we can put the URL they call, but we don't know how to add custom headers.

Thanks in advance.

Sergi
Top achievements
Rank 1
 answered on 26 May 2015
9 answers
182 views

I just tried the excel export with custom binding, of cause I knew it would not get all data with custom binding, it only gets the current page.

I can get the data myself if I could get the filter info, how to get filter info when using excel export?
Thanks

Alan Mosley
Top achievements
Rank 1
 answered on 26 May 2015
11 answers
1.0K+ views

I have a Kendo Grid with dropdownlist for inline Batch updte.When i change the Dropdown list thevalue changes and when it loses the focus , the value of the selected item is displayed in the grid instead of the TextField to be displayed in the grid's dropdownlist. I am using EditorTemplateName for displaying the dropdownlist in the grid.Can you please help me what is wrong and help me correct this issue. I have searched Telerik forum but still couldnt find any help.

 

 

EditorTemplate:
 
@using System.Collections
 
@(Html.Kendo().DropDownList()
    .BindTo((IEnumerable)ViewData["AllTitlesList"])
    .Name("MagTitle")
    .DataValueField("MagDescID")
    .DataTextField("MagTitle")
    .OptionLabel("- Select Title - ")
)
 

Kendo Grid Code: 

 
@(Html.Kendo().Grid<ARMS_WebApi.ViewModel.AncillaryCodes>()
      .Name("grid")
      .Columns(columns =>
      {
          columns.Bound(ac => ac.AncillaryCodeID).Width(75).Title("Id");
          //columns.Bound(ac => ac.MagDescID).Width(150).EditorTemplateName("MagazineTitleTemplate").Title("Title").ClientTemplate("#:MagTitle#");
       
          columns.ForeignKey(ac => ac.MagTitle, (IEnumerable)ViewData["AllTitlesList"], "MagDescID", "MagTitle").ClientTemplate("#:MagTitle#").
             EditorTemplateName("_AllTitlesKendoComboBoxTemplate").Title("Title").Width(100);
          columns.Bound(ac => ac.AncillaryCode).Width(75).Title("Ancillary Code");
          columns.Bound(ac => ac.AncillaryCodeDescription).Width(150).Title("Ancillary Code Description");
          columns.Command(commands =>
          {
              commands.Destroy();
          }).Width(50);
      })
      .ToolBar(toolbar =>
      {
          toolbar.Create();
          toolbar.Save();
          toolbar.Custom().Text("Delete selection")
                   .HtmlAttributes(new { onclick = "deleteSelection(event)" });
      })
              .Editable(editable => editable.Mode(GridEditMode.InCell).CreateAt(GridInsertRowPosition.Top))
                  .Pageable()
                            .Sortable()
                            .Scrollable(scr => scr.Height(300))
                     .Filterable(
                     filterable => filterable
                  .Extra(false)
                   .Operators(operators => operators
                    .ForString(str => str.Clear()
                    .StartsWith("Starts with")
                    .IsEqualTo("Is equal to")
                  .IsNotEqualTo("Is not equal to")
                  .Contains("Contains")
         )))
            .Resizable(resize => resize.Columns(true))
            .Reorderable(reorder => reorder.Columns(true))
              .DataSource(dataSource =>
          dataSource.Ajax()
            .Batch(true)
            .Model(model =>
            {
                model.Id(ac => ac.AncillaryCodeID);
                model.Field(ac => ac.AncillaryCodeID).Editable(false);
            })
                     .Create(create => create.Action("AncillaryCode_Create", "AncillaryCode"))
                     .Read(read => read.Action("AncillaryCode_Read", "AncillaryCode"))
                     .Update(update => update.Action("AncillaryCode_Update", "AncillaryCode"))
                     .Destroy(destroy => destroy.Action("AncillaryCode_Destroy", "AncillaryCode"))
      ))

 

 

 

    

I have a Kendo Grid with dropdownlist for inline Batch updte.When i change the Dropdown list thevalue changes and when it loses the focus , the value of the selected item is displayed in the grid instead of the TextField to be displayed in the grid's dropdownlist. I am using EditorTemplateName for displaying the dropdownlist in the grid.

Can you please help me what is wrong and help me correct this issue. I have searched Telerik forum but still couldnt find any help.

I have a Kendo Grid with dropdownlist for inline Batch updte.When i change the Dropdown list thevalue changes and when it loses the focus , the value of the selected item is displayed in the grid instead of the TextField to be displayed in the grid's dropdownlist. I am using EditorTemplateName for displaying the dropdownlist in the grid.

Can you please help me what is wrong and help me correct this issue. I have searched Telerik forum but still couldnt find any help.

Harish
Top achievements
Rank 1
 answered on 25 May 2015
1 answer
115 views

I have followed the tutorials and have confirmed that I have the latest version on UI for ASP.NET MVC installed, but I still can't get the Marker Click Event to fire on the Map feature. Below is the code I am using, any thoughts?

 

@(Html.Kendo().Map()
                .Name("map")
                .Center(45.5095528, -91.9996693)
                .Zoom(7)
                .Layers(layers =>
                {
                    layers.Add()
                        .Type(MapLayerType.Tile)
                        .UrlTemplate("http://tile2.opencyclemap.org/transport/#= zoom #/#= x #/#= y #.png")
                        .Subdomains("a", "b", "c")
                        .Attribution("&copy; <a href='http://osm.org/copyright'>OpenStreetMap contributors</a>." +
                                     "Tiles courtesy of <a href='http://www.opencyclemap.org/'>Andy Allan</a>");

                    layers.Add()
                        .Type(MapLayerType.Shape)
                        .DataSource(dataSource => dataSource
                            .Read(read => read.Action("HospitalLocations", "Home"))
                            )
                            .LocationField("Location")
                            .Shape(.Pin)
                            .TitleField("Title")
                            .ValueField("ID");
                })
                .Events(events => events.MarkerClick("onClick")))

Alexander Popov
Telerik team
 answered on 25 May 2015
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
Rating
ScrollView
ButtonGroup
CheckBoxGroup
NavBar
ProgressBar
QRCode
RadioButton
Scroller
Timeline
TreeMap
TaskBoard
OrgChart
Captcha
ActionSheet
Signature
AppBar
BottomNavigation
Card
FloatingActionButton
Licensing
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
DateTimePicker
TimePicker
StockChart
RadialGauge
ContextMenu
ArcGauge
+? more
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?