Telerik Forums
UI for ASP.NET MVC Forum
2 answers
409 views
Hello,

I have a multiselect and all i want is to get the value(s) from the datatextfield  instead of the datavaluefield value.
                        @(Html.Kendo().MultiSelect()
                              .Name("PrimaryArea")
                              .Placeholder("Välj primärområde")
                              .DataTextField("Name")
                              .DataValueField("SpatialId")
                              .DataSource(ds => ds.Read("GetAllPrimaryArea", "Report"))
                              .HtmlAttributes(new { @style = "width:200px;" }))


Thanks in advance
Mattias Hermansson
Top achievements
Rank 1
 answered on 14 Mar 2014
2 answers
667 views
Hi guys,

I'm trying to use the bootstrap popover as a tooltip with a kendo grid that has ajax binding. I've put the markup into the ClientTemplate for specific colums and when viewing the source the markup is there. The markup is also valid and if I have static content on the page the popover works, I just can't get it to work on a column in the grid. Not sure if the .popover script isn't finding the columns or something.

Here's my markup:

@using Kendo.Mvc.UI
 
@(Html.Kendo().Grid<OffNormalListing>()
            .Name("grid")
            .DataSource(dataSource => dataSource
                .Ajax()
                .Read(read => read.Action("RefreshTable", "OffNormals"))
                .Sort(sort => sort.Add(x => x.StartTime).Descending())
            )
            .Columns(columns =>
            {
                columns.Bound(x => x.Device).ClientTemplate(
                    "<span class='tooltip-column' data-toggle='tooltip' title='Device Id' data-content='#= Id#'>#= Device#</span>");
                columns.Bound(x => x.Phase);
                columns.Bound(x => x.CurrentStatus);
                columns.Bound(x => x.DeviceType);
                columns.Bound(x => x.Start);
                columns.Bound(x => x.DescriptionDisplay);
                columns.Bound(x => x.OriginalFeeder);
                columns.Bound(x => x.Operator);
                columns.Bound(x => x.ServicePoint);
                columns.Bound(x => x.AbbreviateRegion);
            })
            .Pageable()
            .Sortable()
        )
 
@section scripts
{
    <script>
        function updateTable() {
            var grid = $('#grid').data('kendoGrid');
            if (grid != undefined) {
                grid.dataSource.read();
            }
            $(".tooltip-column").popover({
                trigger: "hover",
                placement: "auto top"
            });
        }
 
        $(document).ready(function () {
            updateTable();
        });
 
        $(window).resize(function () {
            updateTable();
        });
         
    </script>
}

Bil
Top achievements
Rank 1
 answered on 13 Mar 2014
3 answers
315 views
Hi,
Below is my code,

 var _fltMain = { logic: "or", filters: [] };
 var _fltRegion = { logic: "or", filters: [] };
 _fltRegion.filters.push({ field: "Region", operator: "contains", value: searchText });
  var _fltOAMOrders = { logic: "or", filters: [] };
 _fltOAMOrders.filters.push({ field: "OAMOrders", operator: "contains", value: searchText });
 
_fltMain.filters.push(_fltRegion);
 _fltMain.filters.push(_fltOAMOrders);

 $("#reportGrid").data("kendoGrid").dataSource.query({ filter: _fltMain });

This Code works fine for first filter but not working for fltOAMOrders this filter.
It gives error
Microsoft JScript runtime error: Object doesn't support this property or method
((d.OAMOrders || '').toLowerCase().indexOf('56') >= 0)
because it is of type decimal.

Please help.

Thanks,
Sunny.

Nikolay Rusev
Telerik team
 answered on 13 Mar 2014
2 answers
513 views
Hi guys,

I'm swapping out our old layout with the Kendo grid. The old system was just using a @foreach on my model but the new one uses the ajax binding. I'm also refreshing the grid every 20 seconds or so as the displays are used in a control room to monitor the items on the list.

It's going back to the server for the refresh but the spinner is showing and there's a brief flicker when it updates. Is there some way to make it more seamless? In the old system there was no flicker so this might be a problem for the users with the new grid.

Here's my (partial) markup and javascript I'm using:

@using Kendo.Mvc.UI

<ul class="nav nav-pills" id="includeOptions">
    <li class="active"><a href="#" onclick="updateTable();" data-toggle="tab" data-option="0">All</a></li>
    <li><a href="#" onclick="updateTable();" data-toggle="tab" data-option="1">Confirmed Only</a></li>
    <li><a href="#" onclick="updateTable();" data-toggle="tab" data-option="2">Predicted/RMX Only</a></li>
</ul>

@(Html.Kendo().Grid<OutageListing>()
            .Name("grid")
            .HtmlAttributes(new { display = "none"})
            .DataSource(dataSource => dataSource
                .Ajax()
                .Read(read => read.Action("RefreshTable", "Outages").Data("createRefreshPostData"))
                .Sort(sort => sort.Add(x => x.StartDate).Descending())
            )
            .Columns(columns =>
            {
                columns.Bound(x => x.OrderNumber);
                columns.Bound(x => x.Device);
                columns.Bound(x => x.Phase);
                columns.Bound(x => x.CustomerCount);
                columns.Bound(x => x.OutageTypeDisplay);
                columns.Bound(x => x.DeviceType);
                columns.Bound(x => x.LocationDisplay);
                columns.Bound(x => x.StartDateDisplay);
                columns.Bound(x => x.EtrDisplay);
                columns.Bound(x => x.CauseCode);
                columns.Bound(x => x.FeederNumber);
                columns.Bound(x => x.ServicePoint);
                columns.Bound(x => x.AbbreviateRegion);
            })
            .Pageable()
            .Sortable()
        )

@section scripts
{
    <script>

        function createRefreshPostData() {
            return {
                IncludeOption: getIncludeOption()
            };
        }

        function getIncludeOption() {
            return $('li.active > a').data('option');
        }

        function updateTable() {
            var grid = $('#grid').data('kendoGrid');
            if (grid != undefined) {
                var container = $(window);
                var heightAdjustment = 300;
                var containerHeight = container.height();
                containerHeight -= heightAdjustment;
                var rowHeight = 32;
                var newPageSize = Math.round(containerHeight / rowHeight);
                var currentPage = grid.dataSource.page();
                var currentPageSize = grid.dataSource.pageSize();

                if (currentPageSize != newPageSize) {
                    grid.dataSource.pageSize(newPageSize);
                }

                if (currentPage != 1) {
                    grid.dataSource.page(currentPage);
                }
                
                grid.dataSource.read();
            }
        }

        $(document).ready(function() {
            updateTable();
            setInterval(updateTable, "@ApplicationSettings.ListingPageRefreshRate");
        });

        $(window).resize(function() {
            updateTable();
        });

    </script>
}

Thanks!
Dimo
Telerik team
 answered on 13 Mar 2014
1 answer
133 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
146 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
66 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
408 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
640 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
251 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
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
MultiColumnComboBox
Dialog
DropDownTree
Checkbox
Slider
Switch
Notification
Accessibility
ListView (Mobile)
Pager
ColorPicker
DateRangePicker
Wizard
Security
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
+? more
Top users last month
Bohdan
Top achievements
Rank 3
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Elliot
Top achievements
Rank 1
Iron
Iron
Iron
Sunil
Top achievements
Rank 1
Cynthia
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Bohdan
Top achievements
Rank 3
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Elliot
Top achievements
Rank 1
Iron
Iron
Iron
Sunil
Top achievements
Rank 1
Cynthia
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?