Telerik Forums
UI for ASP.NET MVC Forum
3 answers
519 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
518 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
1 answer
124 views
Hi all,

I'm having a already existing code where currently it is using a ulrtawebgrid (infragistic control). Now I'm in the process of replacing the grid to telerik rad grid. 
The problem is that i need to bind the grid programatically and also need to set the group field and al. I have saw so many grouping C# code with a simple list.


If any of you have done the dynamic binding and grouping in C# from a list collection please let me know or share the code snippet.


Thanks in advance ,
Sabitha
Vladimir Iliev
Telerik team
 answered on 26 Jan 2015
1 answer
1.2K+ views
I set the selected item using the first code block below. But I need to pass the item and items value to the selected event function. Which is the second code block below.  i also included the code for the Dropdownlist, the third code block.  How do I do this?  Thanks
function onIncDataBound() {
var dropdownlist = $("#IncludeExclude").data("kendoDropDownList");
if (dropdownlist.dataSource.data().length == 1) {
debugger;
var items = $("li.k-state-selected", $("#IncludeExclude-list"));
dropdownlist.trigger("select", { item: items, value: dropdownlist.text() });
}
}
function onInExSelect(e) {
        debugger;
        var projSq = '@Model.Project.ProjSq';
        var typeDol = $('#type').val();
        var county = $('#county').val();
        var dataItem = this.dataItem(e.item);
        var incExc = dataItem.Value;
        var Url = '@Url.Action("GetDecision", "Shared")';
        $.ajax({
            url: Url,
            type: 'GET',
            dataType: 'HTML',
            data: { cnty: county, projSq: projSq, includeExclude: incExc, type: typeDol }
        })
@(Html.Kendo().DropDownListFor(d => d.RequestFlatten.IncludeExclude)
.Name("IncludeExclude")
.HtmlAttributes(new { style = "width:450px" })
.OptionLabel("Select Include/Exclude")
.DataTextField("Description")
.DataValueField("Value")
.CascadeFromField("Type")
.Events(e => e.Select("onInExSelect").DataBound("onIncDataBound"))
.CascadeFrom("FdolTypeCode")
.AutoBind(false)
.Enable(false)
.DataSource(ds => ds.Read(r => r.Action("GetIncludeExcludeByCountyAndType", "Shared").Data("filterIncludeEx"))
.ServerFiltering(true)))
@Html.HiddenFor(h => h.RequestFlatten.IncludeExclude, new { id = "incExc" })

Mike
Top achievements
Rank 1
 answered on 23 Jan 2015
3 answers
118 views
Our main window is vertically split into two. Left side has a grid and right has other views. We have also enabled Tooltip for the grid. We observed that even if the user moves the mouse pointer beyond the left splitter pane, the tooltip does not disappear. When we inspected the HTML elements, beyond the visible left pane, tr element of all grid rows extends to the right edge of the body and hence mouseout event does not occur.

We attempted to set the grid height and width to match the splitter pane without any success. We have observed this behavior in IE, Chrome and Firefox. We did not try in other browsers.

How to set the grid height and width same as that of splitter pane?
Dimo
Telerik team
 answered on 23 Jan 2015
1 answer
267 views
When the user presses the Enter Key, I want to Save the changes and Move Down one cell unless I'm already on the last cell, then just stay there.  I have the Save part working, but every time it saves the focus jumps to the upper left cell of the grid. 


@(Html.Kendo().Grid<TransactionDetailEditable>()
              .Name("Grid")
              .Columns(columns =>
              {
                  columns.Bound(p => p.Id).Hidden(true).Width(5);
                  columns.Bound(c => c.Sequence).Width(25).Title("Seq").Hidden();
                  columns.Bound(c => c.Account).Width(60).Title("Account");
                  columns.Bound(c => c.PropertyDataCollectorName)
                         .Width(180)
                         .Title("Data Entry Description")
                         .ClientFooterTemplate("<div style='text-align:right'>Total:</div>")
                         .HtmlAttributes(new
                         {
                             style = "text-align:right;"
                         });
                  columns.Bound(c => c.TransactionHeaderId).Width(100).Title("Header Id").Hidden();
                  columns.Bound(c => c.PropertyDataCollectorId).Width(50).Title("PDC Id").Hidden();
                  columns.Bound(c => c.Amount)
                         .Width(95)
                         .Title("Amount")
                         .Format("{0:n}")
                         .HtmlAttributes(new { style = "text-align:right;" })
                         .ClientFooterTemplate("<div style='text-align:right'>#= kendo.toString(sum, 'n2') #</div>");
                  columns.Bound(c => c.Notes)
                         .Width(150)
                         .Title("Notes");
                  columns.Bound(c => c.IsEditable).Hidden();
              })
              .Editable(editable => editable.Mode(Kendo.Mvc.UI.GridEditMode.InCell))
              .Pageable(p => { p.Refresh(true); p.PageSizes(true); })
              .Navigatable()
              .Scrollable()
              .Events(e =>
              {
                  e.Save("onGridSave");
                  // e.DataBound("onDataBound");
                  e.Edit("edit");
              })
              .DataSource(d => d
                                .Ajax()
                                .Aggregates(a =>
                                {
                                    a.Add(p => p.Amount).Sum();
                                })
                                .Batch(true)
                                .PageSize(20)
                                .ServerOperation(false)
                                .Events(e => e.Error("errorHandler"))
                                .Model(model =>
                                {
                                    model.Id(p => p.Id);
                                    model.Field(p => p.Id).Editable(false);
                                    model.Field(p => p.Account).Editable(false);
                                    model.Field(p => p.PropertyDataCollectorName).Editable(false);
                                    model.Field(p => p.Amount).Editable(@ViewBag.Editable);
                                    model.Field(p => p.Notes).Editable(@ViewBag.Editable);
                                })
                                .Read(read => read.Action("Read", "TransactionDetail"))
                                .Update(update => update.Action("Update", "TransactionDetail"))
                                .Create(create => create.Action("Create", "TransactionDetail"))
                                .Destroy(destroy => destroy.Action("Destroy", "TransactionDetail")))
 )        
function onGridSave(e) {
    setTimeout(function (e) {
         var grid = $("#Grid").data("kendoGrid");
         grid.dataSource.sync();
   
         MoveDownOneCell(); 
    });
}

function MoveDownOneCell(){
if (!LastCellInColumn){
MoveDownSomehow;
}
}












Alexander Popov
Telerik team
 answered on 23 Jan 2015
1 answer
284 views
Hi!

Im using a viewmodel that has an enumeration named "status".
The Grid auto-generates a filter from the enum, which is cool. But I'd like to do 2 things in the grid:
1: Change the enum text
2: Hide some enum options.

I attached a print of the filter with all enum options.

This is my grid:
@(Html.Kendo().Grid<MyViewModel>()
    .Name("grid" + gridName)
    .ToolBar(comands => comands.Template(templateHeader))
    .Columns(columns =>
    {
        columns.Bound(c => c.name).Title("Name");
        columns.Bound(c => c.status).Title("Status");
         }
         .Scrollable()
    .Sortable()
    .Filterable()
    .ColumnMenu(c => c.Messages(m => m.SortAscending("Ordem Ascendente").SortDescending("Ordem Descendente").Columns("Colunas")))
        //.Pageable(pageable => pageable.Input(true).Numeric(false))
    .Resizable(resizable => resizable.Columns(true))
    .DataSource(dataSource => dataSource.Ajax().Read(read => read.Action(action, controller).Data("filtroAdicionalCargasPendentes")))
)

Thanks.
Alexander Popov
Telerik team
 answered on 23 Jan 2015
2 answers
226 views
Greetings,

I've created a grid, that displays details of an root-object. The Problem ist, that the detail-object is generated dynamically, so a direct binding to columns is not possible because we don't know what members this object has.

The "anonymous" columns in the detail-object should be filterable, but this doesn't work. Weird, because grouping is working. (The DatasourceRequest-Object in the controller seems to be correct - it has filter-definitions and group-definitions).

How can i get filtering working in my anonymous object?

This is the controller (the object "DynParts" ist the ICollection of the same dynamically created objects):
public ActionResult HierarchyBinding_Types([DataSourceRequest] DataSourceRequest request)
       {
 
           IQueryable<pxCore.Type> _types =_db.Types.OrderBy(t=>t.Kurzzeichen);
                     
           DataSourceResult _dsr = _types.ToDataSourceResult(request, _type => new Typeview(_type, _db));
                                    
           return Json(_dsr);
          
       }
 
       public ActionResult HierarchyBinding_DynParts(Guid typeid, [DataSourceRequest] DataSourceRequest request)
       {
 
           Typeview typeview= new Typeview(_db.Types.Where(w=>w.Id==typeid).FirstOrDefault(), _db);
                       
           DataSourceResult _dsr = typeview.DynParts.ToDataSourceResult(request);
 
           return Json(_dsr);
 
       }


This is the view:
@(Html.Kendo().Grid<pxCore.Type>()
        .Name("grid")
            .Columns(columns =>
            {
                columns.Bound(e => e.Kurzzeichen).Width(110);
                columns.Bound(e => e.Bezeichnung).Width(510);
                 
            })
        .Sortable()
         
        .Scrollable()
        .Filterable(ftb => ftb.Mode(GridFilterMode.Row))
        .ClientDetailTemplateId("template")
        .HtmlAttributes(new { style = "height:700px;" })
        .DataSource(dataSource => dataSource
            .Ajax()
             
            .Read(read => read.Action("HierarchyBinding_Types", "Types"))
        )
        .Events(events => events.DataBound("dataBound"))
)
 
<script id="template" type="text/kendo-tmpl">
    @(Html.Kendo().Grid<object>()
            .Name("grid_#=Id#")
            .Resizable(r=>r.Columns(true))
            .DataSource(dataSource => dataSource
                .Ajax()
                .PageSize(10)
                .Read(read => read.Action("HierarchyBinding_DynParts", "Types", new { typeID = "#=Id#" }))
                 
            )
            .Pageable()
            .Groupable()
            .Filterable(ftb => ftb.Mode(GridFilterMode.Row))
            .Sortable()
            .Reorderable(r=>r.Columns(true))
            .ToClientTemplate()
    )
</script>


Denis
Top achievements
Rank 1
 answered on 23 Jan 2015
3 answers
333 views
Hi, I have a webpage where I load the main page, and then load kendo.ui components (ASP.NET MVC) via ajax calls. On checking, the kendo.all.min.js library - all 1,5 MB of it - gets loaded with every call. That is because I have the scripts included in the page loaded via ajax. However, were I to exclude these scripts, the page loaded via ajax will not work correctly because the kendo.ui components will not work correctly.

How can I make these pages loaded via ajax use the kendo.all.min.js library loaded during the loading of the main page?

Thanks in advance.
Anton
Top achievements
Rank 1
 answered on 23 Jan 2015
3 answers
1.6K+ views
Hi,

I have a sortable, pageable, filterable ajax binding grid with an external search panel inputs and a search button and i need to include these inputs values to
every grid sort, paging and filter actions.

So i need to pass the search input values to the server read action method on every action mentioned above and after that i need to add them to
the DataSourceRequest.Filters object property.

I have search the internet especially for the first part of the issue, and i was able to send additional parameter to the action method as explained 
in your documentation but the the additional parameter get send on the first call only, i don't now if is the default behavior.

Any help.
Dimo
Telerik team
 answered on 22 Jan 2015
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
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
Edmond
Top achievements
Rank 1
Iron
fabrizio
Top achievements
Rank 2
Iron
Veteran
RobMarz
Top achievements
Rank 2
Iron
Fakhrul
Top achievements
Rank 1
Iron
Tejas
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Edmond
Top achievements
Rank 1
Iron
fabrizio
Top achievements
Rank 2
Iron
Veteran
RobMarz
Top achievements
Rank 2
Iron
Fakhrul
Top achievements
Rank 1
Iron
Tejas
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?