Telerik Forums
UI for ASP.NET MVC Forum
2 answers
234 views

I am using MultiColumnComboBox in my application which binds to the datasource correctly but when I click the dropdown button, the list does not render properly. All the data shows in one column. The column headings render properly though.

<div class="col-md-6 col-sm-12" style="margin-top:10px">
     @(Html.Kendo().MultiColumnComboBoxFor(model=>model.Trainers)
        .Name("trainersCombo")
        .DataTextField("emp_badge_no")
        .DataValueField("id")
        .Filter("contains")
        .FilterFields(new string[] { "emp_first_name", "emp_last_name", "emp_company" })
        .Columns(columns =>
        {
            columns.Add().Field("emp_badge_no").Title("Badge No").Width(100);
            columns.Add().Field("emp_company").Title("Company").Width(200);
            columns.Add().Field("emp_first_name").Title("First Name").Width(200);
            columns.Add().Field("emp_last_name").Title("Last Name").Width(100);
         
        })
        .FooterTemplate("Total #: instance.dataSource.total() # items found")
        .HtmlAttributes(new { style = "width:100%;" })
        .Height(400)
        .DataSource(source => source
                .Custom()
                .Transport(transport => transport
                .Read(read =>
                {
                    read.Action("GetAllEmployees", "CourseTrainer").Data("onAdditionalData");
                }))
            )
    )
</div>

and here is the code for GetAllEmployees

public JsonResult GetAllEmployees(string badgeNo)
        {
            var items = db.EmployeeMasters.AsQueryable();
 
            if (!string.IsNullOrWhiteSpace(badgeNo))
            {
                items = items.Where(p => p.emp_badge_no == badgeNo);
            }
 
            var data = items.Select(p => new { p.id, p.emp_badge_no, p.emp_first_name, p.emp_last_name, p.emp_company });
            return Json(data, JsonRequestBehavior.AllowGet);
        }

I have 2018.3.1017.545 version of Kendo.mvc.dll. Below image shows how the data is render in the drop down.

 

Wasim
Top achievements
Rank 1
 answered on 30 Dec 2018
1 answer
381 views

Hi

I have issue with Kendo treeview expanding in my MVC project. I try to expand treeview node (which have children nodes) at same time when I select it. The code went through in .js file without error.  but node didn't expand. Could any one tell me what properly be wrong? below are piece of code.  Thanks.

 

        var selectedNode = $("#treeView").data('kendoTreeView').dataItem(e.node); // selectedNode have correct data after this.
        var treeView = $("#treeView").data('kendoTreeView');
        treeView .expand(selectedNode); //Code went through without error

 

 

Daochuen
Top achievements
Rank 1
Iron
Veteran
Iron
 answered on 28 Dec 2018
1 answer
165 views

Currently evaluating the Upload control, I ideally want only a simple upload button to select local files and do everyting else on my own through the client API.

Especially the gray div (k-widget k-upload k-header) around the button bothers me.

 

My question:

Is it possible to tell the Upload control to simply display the core upload button and omit everything else, even after the user has selected files?

Marin Bratanov
Telerik team
 answered on 26 Dec 2018
3 answers
946 views

Is there a way to get the responsive behavior for the menu to change to a hamburger menu when the screen size is small? I saw this older post and was wonder if anything has changed.

https://www.telerik.com/forums/menu-and-bootstrap

The behavior would be similar to http://getbootstrap.com/examples/navbar/

Thanks

Ivan Zhekov
Telerik team
 answered on 24 Dec 2018
3 answers
1.5K+ views

I've a grid with ajax binding and exports to excel/PDF fine when dealing with less than a thousand records. But when I want to export bigger quantities the grid doesn't do anything at all. I even put breakpoints in both export actions with no luck.

What can I do to solve this issue?

This is my grid:

<script src="~/Scripts/lib/jszip.min.js" type="text/javascript"></script>
<script src="~/Scripts/lib/pako.js" type="text/javascript"></script>
<script src="~/Scripts/KendoUI/ExportPDFCustomizing.js" type="text/javascript"></script>

@(Html.Kendo().Grid(Model)
        .Name("OperacionesDelDia")
        .DataSource(dataSource => dataSource
        .Ajax()
            .Read(read => read.Action("OperacionesDelDia_Read", "Operaciones")
            .Data("PasarParametros"))
        .Aggregates(a =>
            {
                a.Add(p => p.oper_monto).Sum();
                a.Add(p => p.oper_mont_neg).Sum();
            })
        .PageSize(30)
        )
        .Columns(columns =>
        {
            columns.Bound(foo => foo.esto_codigo).Title(Global.Estado);
            columns.Bound(foo => foo.oper_numero)
                .Title(Global.Numero)
                .ClientTemplate("<a onclick=\"showDetails('#= oper_numero #')\" href='\\#'>#= oper_numero #</a>");            
            columns.Bound(foo => foo.merc_codigo).Title(Global.Mercado);
            columns.Bound(foo => foo.oper_nrobol).Title(Global.Boleto);
            columns.Bound(foo => foo.clas_codigo).Title(Global.Clase);
            columns.Bound(foo => foo.tope_codigo).Title(Global.TipoOperacion);
            columns.Bound(foo => foo.ClieNombre).Title(Global.RazonSocial);
            columns.Bound(foo => foo.espe_codigo).Title(Global.Especie);
            columns.Bound(foo => foo.cupo_numero).Title(Global.Cupon).Hidden(true);
            columns.Bound(foo => foo.clie_alias).Title(Global.ClienteAlias).Hidden(true);
            columns.Bound(foo => foo.oper_forigen).Title(Global.FechaOrigen).Format("{0:dd/MM/yyyy}");
            columns.Bound(foo => foo.oper_plazo).Title(Global.Plazo).Hidden(true);
            columns.Bound(foo => foo.oper_fvence).Title(Global.FechaVence).Format("{0:dd/MM/yyyy}");
            columns.Bound(foo => foo.oper_monto).Title(Global.Capital).Format("{0:N}").ClientFooterTemplate("#= kendo.format('{0:N}', sum)#");
            columns.Bound(foo => foo.espe_codcot).Title(Global.EspecieNeg).Hidden(true);
            columns.Bound(foo => foo.oper_tna).Title(Global.Tna);
            columns.Bound(foo => foo.oper_interes).Title(Global.Interes).Hidden(true);
            columns.Bound(foo => foo.oper_mont_neg).Title(Global.Monto).Format("{0:N}").ClientFooterTemplate("#= kendo.format('{0:N}', sum)#");
            columns.Bound(foo => foo.clie_cuit).Title(Global.Cuit).Hidden(true);
            columns.Bound(foo => foo.TipoNroDoc).Title(Global.TipoNroDoc).Hidden(true);
            columns.Bound(foo => foo.usua_codigo).Title(Global.Usuario);
            columns.Bound(foo => foo.usua_alta).Title(Global.UsuarioAlta).Hidden(true);
            columns.Bound(foo => foo.oper_falta).Title(Global.FechaAlta).Format("{0:dd/MM/yyyy}").Hidden(true);
            columns.Bound(foo => foo.liquidada).Title(Global.Liquidado).Hidden(true);
            columns.Bound(foo => foo.usua_surperv).Title(Global.UsuarioSuperv).Hidden(true); 
            columns.Bound(foo => foo.oper_nombre).Title(Global.Operador).Hidden(true); 
            columns.Bound(foo => foo.oper_observ).Title(Global.Observaciones).Hidden(true); 
            columns.Bound(foo => foo.espedesc).Title(Global.EspecieDesc).Hidden(true); 
            columns.Bound(foo => foo.orden_numero).Title(Global.Orden).Hidden(true);
        })
        .Excel(excel => excel
            .FileName("Reporte.xlsx")
            .Filterable(true)
            .AllPages(true)
            .ProxyURL(Url.Action("Excel_Export_Save", "Operaciones"))
        )
            
        .Pdf(pdf => pdf
            .PaperSize("A4")
            .AllPages()
            .Landscape()
            .FileName("Reporte.pdf")
            .ProxyURL(Url.Action("Pdf_Export_Save", "Operaciones"))
        )

        .Events(e => e.PdfExport("ExportarPDF"))
        .ToolBar(t => t.Excel().Text("Exportar a Excel"))
        .ToolBar(t => t.Pdf().Text("Exportar a PDF"))
        .ColumnMenu()
        .Pageable()
        .Sortable()
        .Selectable()
        .Scrollable(s => s.Height(320))
        .Groupable()
        .Resizable(resize => resize.Columns(true))
        .Reorderable(reorder => reorder.Columns(true))
        .Filterable(ftb => ftb.Mode(GridFilterMode.Menu))
    )

<script type="text/javascript">

function PasarParametros() {

        var dpFechaDesde = $("#fechaDesde").data("kendoDatePicker");
        var valorFechaDesde = dpFechaDesde.element[0].value;

        var dpFechaHasta = $("#fechaHasta").data("kendoDatePicker");
        var valorFechaHasta = dpFechaHasta.element[0].value;

        var ddlLiquidadas = $("#liquidadas").data("kendoDropDownList");
        var valorLiquidadas = ddlLiquidadas.element[0].value

        return {
            fechaDesde: valorFechaDesde,
            fechaHasta: valorFechaHasta,
            liquidadas: valorLiquidadas
        };
    }
</script>

 

And these are my actions:

 

[HttpPost]
public ActionResult Excel_Export_Save(string contentType, string base64, string fileName)

        {
            var fileContents = Convert.FromBase64String(base64);

            return File(fileContents, contentType, fileName);
        }

        [HttpPost]
        public ActionResult Pdf_Export_Save(string contentType, string base64, string fileName)
        {
            var fileContents = Convert.FromBase64String(base64);

            return File(fileContents, contentType, fileName);
        }

 

Thank you very much

Preslav
Telerik team
 answered on 24 Dec 2018
1 answer
234 views

When working with the .Group property, there is an option for changing the sort.

.Group(group => group.Add(p => p.fieldname))

it would appear that you should be able to set the System.ComponentModel.ListSortDirection

This is not working, and the documentation is abysmal.

Instead of the group sorting asc, I need it to sort desc.

 

 

 

 

Georgi
Telerik team
 answered on 21 Dec 2018
1 answer
171 views

In my view page, I'm using Kendo.MVC.UI and Html Helpers. But it does not show me the MultiColumnCombBox. This command below gives me an error saying MultiComboBox method is not found.These are the JS files that I've included in my view.

 

@(Html.Kendo().MultiColumnComboBox() .Name("customers") .DataTextField("ContactName") .DataValueField("CustomerID")........

 

<script src="https://kendo.cdn.telerik.com/2018.3.1017/js/jquery.min.js"></script>
<script src="https://kendo.cdn.telerik.com/2018.3.1017/js/kendo.all.min.js"></script>

 

Can you let me know what is missing?

Marin Bratanov
Telerik team
 answered on 20 Dec 2018
1 answer
416 views

Hello. I am trying to implement a dropdownlist and I need some help. I have 2 simple tables (Employee and Department). Each employee belongs to a department and a department can have multiple employees. I am using EF database first approach. EF generated the 2 classes (Employee.cs and Department.cs) and each class has a reference to the other.

This is my controller actionmethod

public ActionResult Kendo()
        {
            db.Configuration.LazyLoadingEnabled = false;
            var departments = db.Departments.ToList();
            ViewData["departments"] = departments;

            var employees = db.Employees.Include(e => e.Department).ToList();
            return View(employees);
        }

The view is

@(Html.Kendo().Grid(Model)
        .Name("Grid")
        .Columns(c =>
        {
            c.Bound(e => e.EmployeeId);
            c.Bound(e => e.FirstName);
            c.Bound(e => e.LastName);
            c.Bound(e => e.Gender);
            c.Bound(e => e.City);
            c.Bound(e => e.Department.DepartmentName);
            //columns.ForeignKey(e => e.DepartmentId, Model.Select(e => e.Department), "DepartmentId", "DepartmentName");
            //columns.Bound(e => e.Department.DepartmentName).EditorTemplateName("DepartmentEditor").Title("Department").Width(250);
            //columns.Command(command => { command.Edit(); command.Destroy(); }).Width(200);
        })
        //.DataSource(d => d
        //    .Ajax()
        //    .ServerOperation(false)
        //)
        .Pageable() //Enable the paging.
        .Sortable() //Enable the sorting.
        .Filterable()
        .Scrollable()
)

The EditorTemplate

@(Html.Kendo().DropDownList()
          .Name("Department")
          .DataValueField("DepartmentId")
          .DataTextField("DepartmentName")
          .BindTo((IEnumerable)ViewData["departments"])
)

 

Issues I am having:

  • I am getting a circular reference if I uncomment the datasource line in the view.
  • I need to have CRUD operations and I need to show the department as a dropdownlist on Edit/Add. On Edit, the dropdownlist needs to select the current department of the employee. 

Thanks.

Georgi
Telerik team
 answered on 20 Dec 2018
2 answers
720 views

Hi,

I have a grid that has one dynamically sized column to maximize space (it contains the most data).  As the browser window is resized to be smaller and that column shrinks, it eventually disappears.  All of the other columns are auto-sized to contents.

Is there a way to set a minimum width for the column so that when I resize the browser window, it will freeze the width of that column when it reaches a certain threshold and scroll instead?

(I am using the MVC suite of controls.)

Thanks!
Brian

Brian
Top achievements
Rank 2
Iron
 answered on 19 Dec 2018
2 answers
198 views

Hello,

I am trying the Kendo Slider for ASP MVC and want to set the inital values programatically. To do this I have this line of code:

 @Html.Kendo.RangeSlider.Name("rangesliderStadtverkehr").Min(0.6).Max(5.5).SmallStep(0.1).LargeStep(1).Values(CDbl(0.6), CDbl(5.5))

 

But when the site is rendered the selectionStart-value is set to 6 and the selectionEnd-value is set to 55. It seems that the decimal-point ist forgotten.

An additional problem is a linebreak at the end of the renderd slider. For both problems I have added an attachment.

Can you help me to fix the problems? Thank you.

Best regards, Martin

Tsvetomir
Telerik team
 answered on 19 Dec 2018
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
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?