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

Hi,

I'm trying to implement a custom command on my grid, which is using server binding, but the button just leads to a 'resource not found' error. My routing looks as it should and I can't see anything else wrong. I should also say that the MVC stuff is actually implemented in an 'area'. All my code is below, could anyone help?

Routing

1.context.MapRoute(
2.   "ControlPanel_default",
3.   "ControlPanel/{controller}/{action}/{id}",
4.   new { action = "Index", id = UrlParameter.Optional }
5.);

Index.cshtml

01.@(Html.Kendo().Grid(Model)
02.    .Name("Grid")
03.    .Columns(col =>
04.    {
05.        col.Bound(p => p.CustomerId);
06.        col.Bound(p => p.aspNetUserID);
07.        col.Command(cmd =>
08.        {
09.            cmd.Edit();
10.            cmd.Custom("Test").Action("Lockout", "Index");
11.        });
12.    })
13.    .Editable(edt => edt.Mode(GridEditMode.PopUp))
14.    .Pageable()
15.    .Sortable()
16.    .Scrollable()
17.    .DataSource(ds => ds
18.    .Server()
19.    .Model(mdl => mdl.Id(p => p.CustomerId))
20.    .Read("Index","Index")
21.    .Update("Update","Index")
22.    .Create("Create","Index")
23.    .Destroy("Destroy","Index"))
24.    )

 

IndexController.cs

01.public class IndexController : Controller
02.{
03.   public ActionResult Index()
04.   {
05.      ViewBag.Title = "Home";
06.      return View(GetCustomers());
07.   }
08.   public ActionResult Lockout(int CustomerId)
09.   {
10.      if (ModelState.IsValid)
11.      {
12.         //var result = CustomerId;
13.         RouteValueDictionary routeValues = this.GridRouteValues();
14.         return RedirectToAction("Index", routeValues);
15.      }
16.      return View("Index");
17.   }
18.}
Steve
Top achievements
Rank 1
 answered on 28 Nov 2016
3 answers
686 views

Hi,

I'm using a AutoComplete in my form (Grid Popup Editor template) and all the Validation works except that on the AutoComplete...(see Picture)

here is the Code for the AutoCompleteFor:

<div class="form-group m-xs">
                    <label class="col-sm-2 control-label">Postleitzahl:</label>
                    <div class="col-sm-2">
                        @(Html.Kendo().AutoCompleteFor(m => m.Postleitzahl)
                            .DataTextField("Postleitzahl_ID")
                            .Filter(FilterType.StartsWith).MinLength(1)
                            .NoDataTemplate("Keine Postleitzahl gefunden")
                            .Suggest(true)
                            .Height(300)
                            
                            .DataSource(source =>
                            {
                                source.Read(read =>
                                {
                                    read.Action("Postleitzahl_Read", "Standorte")
                                        .Data("onAdditionalData");
                                })
                                    .ServerFiltering(true);
                            })
                            .Events(e => e
                                .Select("onPostleitzahlSelect")
                            ))
                        @Html.ValidationMessageFor(model => model.Postleitzahl)
                </div>

 

here the part of the model class:

[Required]
[StringLength(8)]
public string Postleitzahl { get; set; }
[Required]
[StringLength(65)]
public string Ort { get; set; }
[Required]
[StringLength(255)]
Peter Milchev
Telerik team
 answered on 25 Nov 2016
7 answers
267 views

Hi,

We allow users to change the the value in each cells. However, the user doesn't like to see the width changes from displaying text to a textbox mode. Is there any way we can stop it so we keep the same width for the displaying text and textbox?

 

thanks!

Eyup
Telerik team
 answered on 25 Nov 2016
5 answers
471 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
653 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
113 views

Hi,

  • Where to find the new AutoWidth configuration Option?

robert

Nencho
Telerik team
 answered on 24 Nov 2016
3 answers
377 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
290 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
791 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
95 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
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
Security
Wizard
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
SegmentedControl
+? more
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
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?