Telerik Forums
UI for ASP.NET MVC Forum
1 answer
110 views
Hi,
I have a problem when a data type DateTime is shown, the grid is automatically substracting six hours of the DateTime data.
I use kendo.culture="es-EC" to avoid that, but still happening.

In the localhost works fine.

The system is host in Spain and the database too. The reports the grid export have the correct data, the problem seems only appear in the grid column. 

Here's my code:

<script src="@Url.Content("~/Scripts/kendo/2013.3.1324/cultures/kendo.culture.es-EC.min.js")"></script>
 
    <script>
        kendo.culture("es-EC");
</script>

My View:

@(Html.Kendo().Grid(Model)
        .Name("Grid")
        .Columns(columns =>
        {
 
            columns.Bound(p => p.ID_SOLICITUDSERVICIO).Visible(false);
            columns.Bound(p => p.ID_PARTESERVICIO).Visible(false);
            columns.Bound(p => p.NOMBRE_EMPRESA).Title("Cliente");
            columns.Command(command => command.Custom("custom").Text("").Click("MostrarSolicitud")).Title("N°solicitud").Width(75);
            columns.Bound(p => p.SOLICITUD_CLIENTE).Title("ODT");
            columns.Bound(p => p.NOMBRE_ESTADOSOLICITUD).Title("Estado");
            columns.Bound(p => p.FECHA_INICIO).Format("{0: yyyy-MM-dd}").Title("Fecha inicio");
            columns.Bound(p => p.FECHA_FIN).Format("{0: yyyy-MM-dd}").Title("Fecha fin");
            columns.Bound(p => p.HORA_INICIO).Format("{0: HH:mm}").Title("Hora inicio");
            columns.Bound(p => p.HORA_FIN).Format("{0: HH:mm}").Title("Hora fin");
            columns.Bound(p => p.NOMBRE_TIPOSERVICIO).Title("Tipo servicio");
            columns.Bound(p => p.NOMBRE_MARCA).Title("Marca");
            columns.Bound(p => p.NOMBRE_MODELO).Title("Modelo");
            columns.Bound(p => p.SERIE_INVENTARIO).Title("N°serie");
            columns.Bound(p => p.DOCUMENTOS_PROCESADOS).Title("Doc. procesados")
                .ClientFooterTemplate("# if (sum==null) { # Total: #= 0 # # } else { # Total: #=sum# # } #")
                .ClientGroupFooterTemplate("# if (sum==null) { # #= 0 # # } else { # #=sum# # } #");
            columns.Bound(p => p.NOMBRE_UBICACION).Title("Loc./Proc. Equipo");
            columns.Bound(p => p.TECNICO_RESPONSABLE).Title("Técnico responsable");
            columns.Bound(p => p.NUMERO_TECNICOS).Title("N°técnicos");
            columns.Bound(p => p.TOTAL_HORAS).Title("Total de horas")
                .ClientFooterTemplate("# if (sum==null) { # Total: #= 0 # h# } else { # Total: #=sum# h# } #")
                .ClientGroupFooterTemplate("# if (sum==null) { # #= 0 # h# } else { # #=sum# h# } #");
            columns.Bound(p => p.FACTURA_PARTESERVICIO).Title("N°factura");
        })
                       .Sortable()
                       .Pageable(m => m.PageSizes(new int[] { 10, 20, 50, 100 }))
                       .Groupable()
                       .Filterable()
                       .Events(e => e.DataBound("dataBound"))
                       .Scrollable(s => s.Height("auto"))
                       .TableHtmlAttributes(new { style = "table-layout: fixed;" })
                       .Resizable(r => r.Columns(true))
               .DataSource(dataSource => dataSource
                   .Ajax()
 
                                   .Aggregates(aggregates =>
                                   {
                                       aggregates.Add(m => m.DOCUMENTOS_PROCESADOS).Sum();
                                       aggregates.Add(m => m.TOTAL_HORAS).Sum();
                                   })
                           .Read(read => read.Action("LeerExt_MatrizServicios", "Consultas").Data("getParameter"))
               )

I attach some images that explain better the problem.

Regards
Daniel
Telerik team
 answered on 12 Mar 2014
2 answers
136 views
Hi,

I have a problem when the data is shown in the grid.
I want a data from the controller, so I pass the value from the column via a script with ajax, I retrieve the value from the controller ,all fine, but that value doesn't show in the grid. I appreciate if you can help me. 

Here's my code

Html.Kendo().Grid(Model)
        .Name("Grid")
        .Columns(columns =>
        {
            columns.Bound(p => p.ID_SOLICITUDSERVICIO).Visible(false);
            columns.Command(command => command.Custom("custom").Text("").Click("MostrarSolicitud")).Title("N° de solicitud").Width(75);
            columns.Bound(p => p.NUMEROSOLICITUD_FISICO).Title("N° reporte físico");
            columns.Bound(p => p.NUMERO_SOLICITUDCLIENTE).Title("Ticket Cliente");
            columns.Bound(p => p.MARCA).Title("Marca");
            columns.Bound(p => p.MODELO).Title("Modelo");
            columns.Bound(p => p.CODIGO_REPUESTO).Title("Código del repuesto");
            columns.Bound(p => p.DETALLE_REPUESTO).Title("Detalle");
            columns.Bound(p => p.CANTIDAD).Title("Cantidad");
            columns.Bound(p => p.VALOR_UNITARIO).Title("Valor unit.");
            columns.Bound(p => p.VALOR_TOTAL).Title("Valor total").ClientFooterTemplate("$ #=sum#");
            columns.Bound(p => p.PROPIETARIO).Title("Propietario");
            columns.Bound(p => p.ID_REPUESTOSERVICIO)
                //.ClientTemplate("#= Texto_Factura(data) #")
                .Title("N° factura");
            //columns.Bound(p => p.ID_REPUESTOSERVICIO)
            //    .ClientTemplate("#= CheckDevoler(data) #")
            //    .Title("Devolver").Width(60)
            //.Sortable(false).Groupable(false).Filterable(false);
        })
                .Filterable()
                .Sortable()
                .Pageable(m => m.PageSizes(new int[] { 10, 20, 50, 100, 500 }))
                .Groupable()
                .Events(e => e.DataBound("dataBound"))
        .DataSource(dataSource => dataSource
            .Ajax()
            .Read(read => read.Action("LeerExt_DevolucionRepuesto", "Consultas").Data("getParameter"))
                    .Model(model => { model.Id(p => p.ID_SOLICITUDSERVICIO); })
                    .Aggregates(aggregate =>
                   {
                       aggregate.Add(p => p.VALOR_TOTAL).Sum();
                   })
        )

that's the script. in the alert appear the value that i want

<script type="text/javascript">
  
    function Texto_Factura(item) {
        var texto = "<label></label>";
        var urls = "/Consultas/GetRepuestoServicioSinById";
        var idrepuesto = item.ID_REPUESTOSERVICIO;
        var factura = "";
 
        $.ajax({
            url: urls,
            data: { id_repuestoservicio: idrepuesto },
            type: 'GET',
            success: function (data) {
                if (data.FACTURA_REPUESTOSERVICIO != null) {
 
                    factura = data.FACTURA_REPUESTOSERVICIO;
                    alert("<label>" + kendo.htmlEncode(factura) + "</label>");
                    return texto = "<label>" + kendo.htmlEncode(factura) + "</label>";
                }
            },
            error: function (resp) {
                //alert(JSON.stringify(resp));  open it to alert the error if you want
                alert(resp);
                return texto = "<label>" + resp + "</label>";
            }
        });
return texto;
    }
</script>

Thanks.
Misahael
Top achievements
Rank 1
 answered on 11 Mar 2014
1 answer
43 views
Hi

I have two grids.

Grid 1 - User filters out records that are not required.

Grid 2 - I would like to show the records that have been filtered out of Grid 1

Please can you tell me the best way to acheive this?

Kind Regards

David
Alexander Popov
Telerik team
 answered on 11 Mar 2014
1 answer
383 views
I have a grid where when expanding a row I have a dropdownlist that loads it's items via ajax/json.

Now, when I expand multiple rows in 1 shot - the back end controller method used to load the items is called for each drop down (1 per detail expanded row) where the ddl's items are identical for each ddl.

Is there any way client side that we could have multiple dropdownlists refer to one set of items for selection?

Basically - something like:

a) call the controller method via ajax and get the items.
b) have each ddl point to that collection of items

Caching on the server is not an option.
Daniel
Telerik team
 answered on 11 Mar 2014
7 answers
579 views
Hello,
I'm using the sync upload widget.
I would like to be able to add an a custom unique id attribute to the inputs of the files selected.
Unfortunately, the inputs are created after the "Selected" event.
Is there any way i can achieve this?
Dimiter Madjarov
Telerik team
 answered on 11 Mar 2014
5 answers
214 views
Hi,

I have a grid that has a number of columns that will effectively involve horizontal scrolling to see the whole row of data.

I was wondering is it possible to have the first column not scroll and act as a key to the row when the user does scroll horizontally.

Has anyone else had a similar problem, as I have parred down the columns as much as I can.

regards

Pb
Dimo
Telerik team
 answered on 11 Mar 2014
1 answer
243 views
Hi there,

I am using DatePicker in my web page as this.
<td class="td-header-input">
@(Html.Kendo().DatePickerFor(p => p.MyDate).Format("MM/dd/yyyy").ParseFormats(new String[] { "MM/dd/yyyy" })
                                              .HtmlAttributes(new { id = "date_1", data_bind = "value: MyDate", @class = "header-input header-dropdownlist heasder-datepicker", style = "width:100px" })
                                             )
</td>

Instead of the default calendar image shown to the right side of datepicker, I would like to use my own version of image. I tried to set .k-i-calendar like this
.k-i-calendar {
  background: url(../images/myCalendaricon.png) no-repeat center;
  display: inline-block;
}

But nothing shows. not even the default calendar image. Can someone tell me how to use my own image in datePicker?

Thanks.

Dimo
Telerik team
 answered on 10 Mar 2014
2 answers
401 views
I've been having alot of problems getting the MVC extensions working. I finally resorted to starting up a brand new "c# Kendo UI for MVC Web Application". I start it up and straight away in the Chrome developer tools I see the following errors:

Uncaught SyntaxError: Invalid regular expression: missing / kendo.all.min.js:10
Uncaught TypeError: Cannot read property 'jQuery' of undefined kendo.aspnetmvc.min.js:10

I checked all the FQAs about these errors and confirmed that everything (web.config, Single JQuery reference, etc...) and everything looks good. Moreover, I tried to add a grid and I'm seeing :

Uncaught TypeError: Object [object Object] has no method 'kendoGrid'

I've attached the sample project that I created.
Bil
Top achievements
Rank 1
 answered on 10 Mar 2014
3 answers
879 views
Hi,

I have two series of type

Series 1: {Date:1/1/2011,Hitcount:3,Date:1/12/13,Hitcount 4}

Series 2:{Date :1/1/2011,Hitcount 5,Date:1/12/13:Hitcount 5}

How do I generate Multiple series using dynamic binding

my kendo chart currently looks liek this 

  @(Html.Kendo().Chart<kendoNet.Models.ChartSeries>() // The chart will be bound to the Model which is the InternetUsers lis
                      .Name("Chart3")
                      .Title("Test")


                // The name of the chart is mandatory. It specifies the "id" attribute of the widget.
                       .DataSource(dataSource =>
                                dataSource.Read(read => read.Action("Series", "Home", new  { plname=ViewBag.Pl,test="VCS"})) // Specify the action method and controller name
                                )
                                .Legend(legend => legend
                                    .Position(ChartLegendPosition.Bottom)
                                ).ChartArea(chartArea => chartArea
                                    .Background("transparent")
                                ).SeriesDefaults(seriesDefaults =>
                                    seriesDefaults.Line().Style(ChartLineStyle.Smooth)
                                )
                                .Series(series =>
                                {
                                       //MODEL IS DICTIONARY CONTAINING THE TWO SERIES 1 AND SERIES 2 ,HOW DO WE DISPLAY MULTIPLE SERIES HERE
                                      series.Line(model => model.Values).Name("HitCount").Labels(labels => labels.Visible(true).Color("Red")).Color("Blue");                                                

                                })

                                .CategoryAxis(axis => axis
                                //.Categories(model => model.Date)
                                .Labels(labels => labels.Rotation(-65)

                                )

                                )
                       
                        .ValueAxis(axis => axis
                            .Numeric().Labels(labels => labels.Format("{0}"))
                            .Line(line => line.Visible(false))
                            .AxisCrossingValue(-10)
                        )
                        .Tooltip(tooltip => tooltip
                            .Visible(true)
                            .Format("{0}")
                        )
        )
Daniel
Telerik team
 answered on 10 Mar 2014
2 answers
388 views
Hi 
How to add check box in panelbar item and binding data from entity framework.  
Petur Subev
Telerik team
 answered on 10 Mar 2014
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?