Telerik Forums
UI for ASP.NET MVC Forum
2 answers
1.0K+ views
Hi,

How to change the FilterDescriptor.member name in the view ?

columns.Bound(e => e.Name).Filterable(true);

In the above sample, the filter will set the Member to "Name", because this is the name of the property bound to the column.
What if I want to change the member name, is that possible ??
Thanks.
Jacob
Top achievements
Rank 1
 answered on 27 Jan 2015
1 answer
135 views
Hi, I'm just getting started using UI for ASP.NET MVC and love the default popup editor. I was wondering how to create a popup editor that only shows editable data for one individual cell. Right now I have cells in a column that represent a grid of 3x3 numerical values and need the ability to edit these en masse. Right now I can edit my rows easily using inline, but this column and a few others display a List<type> of items that I have to write html elements for in javascript.

.Columns(columns =>
    {
        columns.Bound(p => p.LEXId).Hidden(true);
        columns.Bound(p => p.LEXName).Title("Name");
        columns.Bound(p => p.LEXDescription).Title("Description");
        columns.Bound(p => p.AllTranches).ClientTemplate("#= tranchesTemplate(data) #"); //edit these cells in a popup
        columns.Bound(p => p.ComponentName1).Title("Comp1");
        columns.Bound(p => p.ProximityTranche1).Title("Proximity");
        columns.Bound(p => p.ComponentName2).Title("Comp2");
        columns.Bound(p => p.ProximityTranche2).Title("Proximity");       
        columns.Bound(p => p.IsActive);
 
        columns.Command(cmd => cmd.Edit()).Title("Update");
    })

<script type="text/javascript">
     
    function tranchesTemplate(item) {
        var html = "<table>";
        for (var i = 0; i < item.AllTranches.length; i++) {
            if (item.AllTranches[i]) {
                if ((i % 3 == 0) || (i == 0)) {
                    html += "<tr>";
                    html += "<td>";
                    html += item.AllTranches[i];
                    html += "</td>";
                } else {
                    html += "<td>";
                    html += item.AllTranches[i];
                    html += "</td>";
                }
            }
        }
        html += "</tr>";
        html += "</table>";
        html += "<table>";
        html += "<tr>";
        html += "<td><a class=k-button tranche-edit>Edit</a></td>";
        html += "</tr>";
        html += "</table>";
        return html;
    }
</script>

So I have all the tranches populated with the appropriate values, is there some way to quickly build out a popup 3x3 grid using jQuery? Apologies in advanced if this is answered somewhere, but my team lead is urging me to post on here. :)
Alexander Popov
Telerik team
 answered on 27 Jan 2015
1 answer
206 views
Hi,
I am try to looking for the solution to fix  kendo Grid's vulnerability, the vulnerability had find by WebInpsect vulnerability scanner.
when the scanner send a attack post parameter like:

sort=%0d%0aSPIHeader:%20SPIValue&page=1&pageSize=6&group=&filter=&AreaId=-1&DisciplineId=-1&FieldId=-1&MajorId=-1&Keyword=

the scanner attack sort parameter,  I got a error  "DbSortClause expressions must have a type that is order comparable.", that seems sort parameter value problem, but I never assign sort parameter,

another problem is the scanner send another attach paramter "sort=&page=1%0d%0aSPIHeader:%20SPIValue&pageSize=6&group=&filter=&AreaId=-1&DisciplineId=-1&FieldId=-1&MajorId=-1&Keyword="
I got a exception 
 System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer&amp; number, NumberFormatInfo info, Boolean parseDecimal) +14345541

It's seems another Poor Error Handling issue in kendo grid.

Can any one give me some suggestion to fix those problems ?

Thanks, Regards,

Alexander Popov
Telerik team
 answered on 27 Jan 2015
1 answer
442 views
We are using kendo treeview to display hierarchial datasource in cshtml.

One of our requirement is to check/uncheck all children checkboxes when a parent is checked/unchecked, so we used checkChildren property to
achieve this.

@(Html.Kendo().TreeView()
      .Name("SampleList")
      .Checkboxes(chk => { chk.CheckChildren(true); })
      .DragAndDrop(false)
      .ExpandAll(true)
.....


But the issue is when we uncheck a child, the parent should not get unchecked, even if we have one child inside the parent.

Can you please provide jquery code snippet to achieve this?

Thanks.
Daniel
Telerik team
 answered on 27 Jan 2015
1 answer
234 views
Hi there
My question is about Gantt chart and ability to drag some div (pseudo task in my case) to Gantt area and drop it there, then i want to execute "task create event" and open new task window. Does MVC Gantt controls support such functionality?
Best Regards
Krzysiek
Bozhidar
Telerik team
 answered on 27 Jan 2015
4 answers
104 views
Hi,

Working with MVC5 and Kendo().Grid.
Using filter on columns, won't fire the javascript function with the right params or I don't understand how to !!
The aim is to remove the decimals from the integer in the filter box.

This is what I have:
.Columns(columns =>
    {
        columns.Bound(e => e.InternalId).Width(60).Filterable(filter => filter.UI("NumericFilter()"));
    })

-and the function:
function NumericFilter(control) {
    alert ("Got here...");
    $(control).kendoNumericTextBox({ "format": "n0", "decimals": 0 });
}

When the function is called, the param is null. If removing the parentheses from the function name in the filter definitions, the call is not fired at all.
The above code is found somewhere else on this site.
Thanks.
Rosen
Telerik team
 answered on 27 Jan 2015
1 answer
257 views

We are using Kendo controls (date picker, numeric text box, dropdown) in our cshtml pages along with other standard html controls.

When using "shift + tab", the reverse movement halts at a datepicker.

Dropdown and other kendo controls are working fine for same process.

Following settings are applied to all DatePickers:

datepicker.setOptions({
     format: "dd/MM/yyyy",
     parseFormats: ["dd/MM/yy"],
     culture: window.culture,
     min: new Date(1000, 0, 1),
     max: new Date(9999, 11, 31),
     value: dateValue
});

Please note:
    1. This behavior is common in all browsers like Internet Explorer, Firefox, Chrome
    2.  Kendo js version: Kendo UI Complete v2013.3.1324

Please advise how to make Shift+Tab work for this scenario.

Dimo
Telerik team
 answered on 26 Jan 2015
4 answers
119 views
A grid has a child grid in it, which opens on click of icon in a row.
The filter popup of the parent grid opens outside the height of grid but the child grid's filter popup is inside the parent's grid boundary/height.
Attaching snapshot of how it looks.
Is there a way to fix it ?
Dimo
Telerik team
 answered on 26 Jan 2015
3 answers
496 views
From the version 2014.3.1119 we have got export to PDF.  This feature is really nice, but I cannot find a way to correctly display polish charactes in PDF. Probably in other languages it will be the same. Export to Excel from then same place works fine. I've tried on your demo (Kendo.Mvc.Demo) changing unit pdf_export.cshtml. below is the changed code and the screens.
[code]@(Html.Kendo().Grid<Kendo.Mvc.Examples.Models.EmployeeViewModel>()
.Name("grid")
.HtmlAttributes(new { style = "width: 900px; font-family: Arial Unicode MS" })
.Columns(columns =>
{
columns.Bound(e => e.EmployeeID).Width(140).Title("Zdjęcie");
columns.Bound(e => e.Title).Width(400).Title("Szczegóły");
............................
.ToolBar(tools => tools.Pdf())
.Pdf(pdf => pdf
.FileName("Kendo UI Grid Export.pdf")
.ProxyURL(Url.Action("Pdf_Export_Save", "Grid"))
)
.DataSource(dataSource => dataSource
.Ajax()
.Read(read => read.Action("Pdf_Export_Read", "Grid"))
)
..............................[/code]
Controler I've reminded unchanged. In webbrowse as well as in PDF Complete (and other pdf viewers) the polish characters are display wrong. Export to XLS  is OK. Is it possible in MVC to change default font name only for export to PDF.

Kiril Nikolov
Telerik team
 answered on 26 Jan 2015
3 answers
506 views
Hi,
I'm using a Grid popup editing with custom editor I'd like to use upload control with initially files loaded from a path that depends by the Id field (taskID) of the ViewModel (TaskViewModel).
Here it is the code I'm using:

   @(Html.Kendo().Grid<Telerik_Tecnim.Models.TaskViewModel>()
                    .Name("Grid")
            .Columns(columns =>
            {
                columns.Bound(o => o.taskID);
                columns.Bound(o => o.Cont);          
  ....
            })
            .DataSource(dataSource => dataSource
                .Ajax()
                .PageSize(10)
                .Model(model =>
                {
                    model.Id(o => o.taskID);
                    model.Field(o => o.taskID).Editable(false);
   ....
                  
                })
                                .Create(update => update.Action("Task_Create", "Task", new { id = "#=ticketID#" }))
                                .Read(read => read.Action("Task_Read", "Task", new { ticketID = "#=ticketID#" }))
                                .Update(update => update.Action("Task_Update", "Task"))
                                .Destroy(update => update.Action("Task_Destroy", "Task"))               
            )
            .Pageable()
            .ToolBar(toolbar => toolbar.Create())
            .Editable(editable => editable.Mode(GridEditMode.PopUp).TemplateName("Task")))
            .Sortable()
            .ToClientTemplate()The editor template, task.cshtml, is:@model Telerik_Tecnim.Models.TaskViewModel
...
<div>
    @(Html.Kendo().Upload()
              .Name("files")
              .Async(a => a
                  .Save("SaveAndPersist", "Upload", new { id = "#=taskID#" })
                  .Remove("RemoveAndPersist", "Upload", new { id = "#=taskID#" })
                  .AutoUpload(true)           
              )
                      .Files(files =>
                      {
                          foreach (var f in Model.UploadFiles)
                          {
                              files.Add().Name(f.Name).Extension(f.Extension).Size(f.Size);
                          }
                      })
    )
</div>

TaskViewModel is:
...
namespace Telerik_Tecnim.Models
{
    public int taskID { get; set; }
 ....
    public class TaskViewModel
    {
        .....
        public IList<Telerik_Tecnim.Models.UploadFileViewModel> UploadFiles
        {            get
            {                return SessionUploadInitialFilesRepository.GetAllInitialFiles(this.taskID);
            }            set
            {            }        }
    }
}

Unfortunately Model.UploadFiles in editor template seems to be empty (any file is show in uplaod control) but if I check the data with Fiddler UploadFiles is not empty!
How to use upload with initially files in editor template from a variable path depended by a field of the model?
Thanks in advance
Daniel
Telerik team
 answered on 26 Jan 2015
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?