Telerik Forums
UI for ASP.NET MVC Forum
5 answers
423 views

Hello,

After spending a couple of hours trying to figure out why my custom popup editor template was failing with this javascript error in the kendo.all.min.js file: "0x800a03f1 - JavaScript runtime error: Expected '}' "

it turned out to be an inline javascript comment that was causing the error.  I have a script tag at the top of my template with a couple of javascript functions and in them are some single-line comments using the '//' syntax.  When I remove those the popup editor works just fine and when I put them back in it throws the error. Why is this happening? Is this a known issue? Is it documented anywhere?

 

Thanks,

Mike

 

 

Kostadin
Telerik team
 answered on 25 Nov 2016
4 answers
604 views

I have a grid which looks good on until 1400 screen resolution but if i try to go less than that, i don't see right most columns. I don't want to use vertical scroll bar, so I have used this 

 

.Scrollable(s => s.Height("auto"))

 

But even this, slight changed my grid look. column width changed. I have attached some screen shots so that you can see the difference

Desenvolvimento
Top achievements
Rank 2
 answered on 24 Nov 2016
3 answers
86 views

Hi,

  • Where to find the new AutoWidth configuration Option?

robert

Nencho
Telerik team
 answered on 24 Nov 2016
3 answers
358 views

I have an issue when i tried to show more than one grid in the view.

This is my first grid that works fine.

@model IEnumerable<CampeonatoFutbol.Models.PartidoClub>

 @(Html.Kendo().Grid(Model)
        .Name("grid")
        .Columns(columns =>
        {
            columns.Bound(c => c.ClubDesc).Title("EQUIPO").Width(220);
            columns.Bound(c => c.PrtidoCodigo).Title("PJ").Width(60);
            columns.Bound(c => c.GolesClub).Title("GC").Width(60);
            columns.Bound(c => c.PuntosClub).Title("PUNTOS").Width(150);
        })
        .HtmlAttributes(new { style = "height: 300px;" })
        .Scrollable()
        .Reorderable(reorder => reorder.Columns(true))
        .Pageable(pageable => pageable
            .PageSizes(true))
        .DataSource(dataSource => dataSource
            .Ajax()
            .PageSize(20)
        )
)

And this the method action of the controller that render the html of that grid.

public ActionResult Campeonato()
{

     //return a list for the grid

}

 

and whe i tried to put another grid in the same view, the second grid doesn´t show me anything

This is the second grid that i tried to use:

 @(Html.Kendo().Grid<CampeonatoFutbol.Models.PartidoClub>()
                    .Name("gridGoleadores")
                    .Columns(columns =>
                    {
                        columns.Bound(c => c.NombreJugador).Title("JUGADOR").Width(220);
                        columns.Bound(c => c.ClubDesc).Title("EQUIPO").Width(60);
                        columns.Bound(c => c.GolesJugador).Title("GOLES").Width(60);
                    })
                    .HtmlAttributes(new { style = "height: 300px;" })
                    .Scrollable()
                    .Reorderable(reorder => reorder.Columns(true))
                    .Pageable(pageable => pageable
                    .PageSizes(true))
                    .DataSource(dataSource => dataSource
                    .Ajax()
                    .Read(read => read.Action("GoleadoresCampeonato", "Campeonato"))
                    .PageSize(20)
                    )
                )

And this is the method action that it's never called:

 public ActionResult GoleadoresCampeonato([DataSourceRequest]DataSourceRequest request)
{

    return Json(list.ToDataSourceResult(request) ) 

}

 

I hope someone can helpme whit this.

Kostadin
Telerik team
 answered on 24 Nov 2016
10 answers
267 views
Hi to everyone...

I have a problem with the kendo grid on IE 11

@(Html.Kendo().Grid(Model)  
    .Name("Grid")  
    .Columns(columns =>
    {
        columns.Bound(m => m.ID).Title("ID").Hidden(true);
        columns.Bound(m => m.DESC).Title("DESC");    
    })    
    .Selectable(s => s.Mode(GridSelectionMode.Single))    
    .DataSource(d=>d.Server().Model(mod=>mod.Id(m=>m.ID)))
    )

This configuration properly works on old IEs or other browser like Firefox, but on IE11 the row doesn't get selected on mouse click.
It seems to me that the k-state-selected class is not added to the selected row and due this lack the js function grid.select() is not working too.

thank's for your help
mauro


Kiril Nikolov
Telerik team
 answered on 24 Nov 2016
1 answer
755 views
Recently When I create new "Telerik ASP.NET MVC Application" Project .. All resource files that related to Kendo UI are referenced to CDN instead of local files and there are no any local files exist for Kendo UI like before .. I don't know if this is a new change in Telerik MVC Project or I did something by mistake ?
I need to include Kendo UI resource files as local files instead of using CDN Files.
Orlin
Telerik team
 answered on 24 Nov 2016
1 answer
70 views

Requirements

Telerik Product and Version

2014.3.1411.440

Supported Browsers and Platforms

GoogleChrome

Components/Widgets used (JS frameworks, etc.)

UIGrid


PROJECT DESCRIPTION 
[enter description here, together with step-by-step instructions on how to use the project]
We have several pages where we have noticed that the sorting of the grid is not working. We are attempting to sorty by four columns but to no luck we are able to get the desired results.. Attached is a sample of the binding as well as the controller method that retrieves the method.

I have tried binding it both in the controller using OrderBy, ThenBy extensions as well as the sort in the grid binding. Additionally I have also sorted the results within the method that the controller calls and have reviewed it with LinqPad and it appears to be sorting correctly. However I cannot get it bind sorted in the grid. Any help will be appreciated.

Grid Binding

Scrollable(a => a.Height("auto"))
                  .Sortable()
                  .PrefixUrlParameters(false)
                  .Filterable()
                  .Pageable(pageable => pageable
                      .Refresh(true)
                      .PageSizes(new[] { 50, 100, 250, 500, 1000 })
                      .Messages(messages => messages.ItemsPerPage(" items are currently displayed"))
                      .ButtonCount(5))
                  .DataSource(dataSource => dataSource
                      .Server().PageSize(250)
                      .Sort(s =>
                          {
                              s.Add(c => c.EAN).Ascending();
                              s.Add(c => c.IngramSku).Ascending();
                              s.Add(c => c.BusinessYear).Descending();
                              s.Add(c => c.BusinessMonth).Descending();                             

 

Controller Method Logic

var viewModel = new ViewModels.RAM.VendorQuarterlyRevenueViewModel()
           {
               VendorId = vendorId,
               VendorName = GetVendorName(vendorId),
               sort = sort,
               filter = filter,
               group = group,
               ShowDataGrid = true,
               ReportDate = new ViewModels.RAM.ReportDateViewModel()
               {
                   BeginDate = beginDate,
                   EndDate = endDate,
                   MaxDate = maxDate,
                   MinDate = minDate,
               },
               VendorQuarterlyRevenueData = _ramReportRepository.GetVendorQuarterlyRevenue(_ramReportRepository.GetContext(), beginDate, endDate, vendorId)
           };
 
           if (dataSourceRequest.Filters != null)
           {
               viewModel.VendorQuarterlyRevenueData = (IQueryable<VendorRevenueModel>)viewModel.VendorQuarterlyRevenueData.Where(dataSourceRequest.Filters);
           }
 
 
           foreach (var item in viewModel.VendorQuarterlyRevenueData)
           {
               viewModel.FreightRevenueSum += item.FreightRevenue;
               viewModel.NetSalesSum += item.NetSales;
               viewModel.RentalIncomeSum += item.RentalIncome;
           }
 
 
           return View("VendorQuarterlyRevenueReport", viewModel);

 

Vasil
Telerik team
 answered on 23 Nov 2016
1 answer
1.2K+ views

This is the situation: I have a form that when i click in the submit button is sending a file with the kendo upload control, and the method action of the controller is receiving that file in the parameter with the HttpPostedFileBase.
This is my HTML code:

 

@using (Html.BeginForm("ConfirmarOposicion", "Gestion", FormMethod.Post, new { @id = "Frm-login", role = "form", @class = "form-horizontal" }))

{

    @(Html.Kendo().Upload()

        .Name("files")

    )

    <button class="btn btn-success" type="submit" id="confirm" >Confirm</button>

}

And this is my controller:

public async Task<ActionResult> ConfirmarOposicion(IEnumerable<HttpPostedFileBase> files)

{

    // Here the parameter files is not null..

}

Here is working all good till now. The problem is when i try to send more values as parameter into the same method of the controller. The other values that i want to send is an array, and the other is a number. This two values i try to send with ajax in javaScript.
This is my javaScript code when i try to send those two more values:

$("#confirm").click(function ()

{

    var numMarca = $("#numMarca").val()

    var idsToSend = [];

    var grid = $("#Grid2").data("kendoGrid")

    var ds = grid.dataSource.view();

    for (var i = 0; i < ds.length; i++)

    {

        var row = grid.table.find("tr[data-uid='" + ds[i].uid + "']");

        var checkbox = $(row).find(".checkbox");

        if (checkbox.is(":checked"))

        {

            idsToSend.push(ds[i].DescMarca);

            idsToSend.push(ds[i].IntencionOposicion = 1);

        }

        else

        {

            idsToSend.push(ds[i].DescMarca);

        }

    }

    $.ajax({

        url: '@Url.Action("ConfirmarOposicion", "Gestion")',

        data: { ids: idsToSend, marca: numMarca },

        type: 'POST',

        dataType: "json",

        success: function (data)

        {

             ...

        }

 

When i clik the submit button is sending this two values in the same controller that i send the input file.
And this my controller now:

public async Task<ActionResult> ConfirmarOposicion(IEnumerable<HttpPostedFileBase> files, string[] ids, string marca)

{

    // here the array ids and the value of marca is not null, but the parameter files it is null

}

And that's the issue that i have.
I need to send all those values in the same method action of the controller.
How can i do that?

Peter Milchev
Telerik team
 answered on 23 Nov 2016
1 answer
288 views

This is a two part question, first how do I know what controller parameters are needed fro the update action for the tree view (Same question applies to all Kendo controls) No error is thrown so I don't known what route (route signature) to build.

 

Second, could be related to the first my action is public JsonResult Update([DataSourceRequest] DataSourceRequest request, ProductViewModel product) but when I do a drag and drop the action isn't fired.  I have found when this happens typically it is because I don't have a matching signature for the route... but again no error is thrown so I can't debug it. 

 

Thanks in advance and sorry if I am not using the correct terminology for this.

Viktor Tachev
Telerik team
 answered on 23 Nov 2016
1 answer
151 views

Hi,

it seems that the selection in the AutoComplete is not correct (see attached Pictures) - it should be the same as the other Dropdowns (Combo, list)

robert

Nencho
Telerik team
 answered on 23 Nov 2016
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
DateTimePicker
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
TimePicker
StockChart
RadialGauge
ContextMenu
ArcGauge
AICodingAssistant
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
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
Iron
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?