Telerik Forums
UI for ASP.NET MVC Forum
1 answer
566 views

Requirements

Telerik Product and Version

Version 2014

Supported Browsers and Platforms

Google chomre

Components/Widgets used (JS frameworks, etc.)

asp.net mvc

Hi,

I have a grid  and binded it like this

 

    @(Html.Kendo().Grid<dynamic>()
                            .Name("GridCostTiers")

 .Columns(columns =>
                            {

                                        columns.Bound(gridColumn.field).Title(gridColumn.caption).Visible(gridColumn.visible).Width(BusinessManager.GetColumnWidth(gridColumn.field, gridColumn.width));

}

 

I want to Apply filter on this grid, when Allied filter, filter doesnot working any  one can please guide how i can enable filter on .

 

if grid is not dynamic ,Applied filer working fine.

Thanks,

 

Konstantin Dikov
Telerik team
 answered on 09 Jan 2017
1 answer
505 views

Hi,

I have a treeview and a grid where the select node id is used in the Data Event from the grid to filter the data based on the treeview selection.

function onMitglieddokumente_DataFilter() {
    var treeView = $("#tvwDokumentenablagestruktur").data("kendoTreeView");
    var selectedNode = treeView.select();
    var id = 1;       
    if (selectedNode.length != 0) {
        var item = treeView.dataItem(selectedNode);
        id = item.id;                  
    }
    return {
        mitgliedid: @ViewContext.RouteData.Values["mitgliedid"],
        ordnerid: id
    };
}

 

in the Treeview onSelect Event I refresh the grid datasource:

function onTreeviewChange(e) {
        $("#gridMitglieddokumente").data("kendoListView").dataSource.read();
    };

 

the Problem with that solution is, that I always get the latest selection of the Treeview not the current one!

if I use the onChange Event the refresh is fired more than ones because it fires on selection and on expand...

robert

 

Alex Gyoshev
Telerik team
 answered on 09 Jan 2017
2 answers
169 views

Here is the code for my parent grid.

@(Html.Kendo().Grid<Wcs.Applications.Web.SoldevPortal.Models.NetworkMap.ManagementNetworks.ManagementNetworkViewModel>()
    .Name("ManagementNetworkGrid")
    .Columns(columns =>
    {
        columns.Bound(c => c.IpNetworkAddress);
        columns.Bound(c => c.IpSubnetMask);
        columns.Bound(c => c.DevicesDiscovered);
        columns.Bound(c => c.DevicesPolled);
        columns.Command(command => { command.Custom("Poll").Click("poll"); command.Edit(); command.Destroy(); });
    })
    .ToolBar(toolbar =>
    {
        toolbar.Create();
    })
    .Editable(editable => editable.Mode(GridEditMode.InLine))
    .ClientDetailTemplateId("managementNetworkDetail")
    .DataSource(dataSource => dataSource
        .Ajax()
        .Model(model =>
        {
            model.Id(m => m.IpNetworkAddress);
            model.Field(m => m.DevicesDiscovered).Editable(false);
            model.Field(m => m.DevicesPolled).Editable(false);
        })
        .Create(create => create.Action("ManagementNetworks_Create", "NetworkMap").Data("AttachAntiForgeryToken"))
        .Read(read => read.Action("ManagementNetworks_Read", "NetworkMap"))
        .Update(update => update.Action("ManagementNetworks_Update", "NetworkMap").Data("AttachAntiForgeryToken"))
        .Destroy(destroy => destroy.Action("ManagementNetworks_Destroy", "NetworkMap").Data("AttachAntiForgeryToken"))
        .PageSize(20)
        .Sort(sort => sort.Add(s => s.IpNetworkAddress).Ascending())
    )
)

 

And here is the code for my client detail template grid.

<script id="managementNetworkDetail" type="text/kendo-tmpl">
    @(Html.Kendo().Grid<Wcs.Applications.Web.SoldevPortal.Models.NetworkMap.ManagementNetworks.ManagementNetworkDetailViewModel>()
        .Name("ManagementNetworkGrid_#=IpNetworkAddress#")
        .Columns(columns =>
        {
            columns.Bound(c => c.NetworkDeviceId);
            columns.Bound(c => c.Name);
            columns.Bound(c => c.Description);
            columns.Bound(c => c.EthernetInterfaces);
        })
        .DataSource(dataSource => dataSource
            .Ajax()
            .Read(read => read.Action("ManagementNetworks_Detail", "NetworkMap", new { ipNetworkAddress = "#=IpNetworkAddress#" }))
            .Sort(sort => sort.Add(s => s.NetworkDeviceId).Ascending())
        )
        .ToClientTemplate()
    )
</script>

 

However when I expand a row in the parent grid, there is no data in the child grid. Looking at the Network tab in my browser's debug tools, I can see that no GET request is being sent. There are no errors in the browser's console. Hopefully someone can help me get to the bottom of what I'm doing wrong.

Thanks in advance.

Derek
Top achievements
Rank 1
 answered on 09 Jan 2017
2 answers
1.0K+ views

Hi Team,

I am working on a Client-Side paging grid (ServerOperation(false)). However, the web still send a request to the server when I click the paging and sorting button. Also, the filter doesn't work. I can see the filter icon, but when I click on it, nothing happens.

My view:

@model IEnumerable<INSYNC_Test.Models.Staffs>

@{
    ViewBag.Title = "Index";
}

<h2>Index</h2>

@(Html.Kendo().Grid(Model).Name("staffs").Columns(c =>
{
    c.Bound(p => p.Firstname);
    c.Bound(p => p.Lastname);
    c.Bound(p => p.JobTitle);

})
.DataSource(d=>d
.Ajax()
.ServerOperation(false)
)
.Pageable()
.Filterable()
.Sortable()
)

 

 

My controller:

using INSYNC_Test.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace INSYNC_Test.Controllers
{
    public class testController : Controller
    {
        // GET: test
        public ActionResult Index()
        {
            var db = new OSHODSEntities();
            var staffs = db.Staffs.Select(p => new Models.Staffs
            {
                ID = p.ID,
                Firstname = p.Firstname,
                Lastname = p.Lastname,
                JobTitle = p.JobTitle,
                locat = p.locat,
                dept = p.dept,
                status = p.status,

            });
            return View(staffs);
        }
    }
}

 

my viewmodel:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace INSYNC_Test.Models
{
    public class Staffs
    {
        public int ID { get; set; }
        public string Firstname { get; set; }
        public string Lastname { get; set; }
        public string JobTitle { get; set; }
        public string locat { get; set; }
        public string dept { get; set; }
        public int status { get; set; }
    }
}

Vince
Top achievements
Rank 1
 answered on 06 Jan 2017
9 answers
4.6K+ views
I've got a kendo grid with an image near it that will act like a button. When pressed, it will call a controller method. I want to send the selected row data to that method.

**VIEW**

<a href="#" id="ic_open" class="tooltip2" title="Abrir">
    <span title="">
        <img class="toolbar-icons" src="../../Images/open.png"/>
    </span>
</a>
...
<div id="datagrid">
    @(Html.Kendo().Grid(Model)
        .Name("datagrid_Concessoes")
        .Columns(columns =>
        {
            columns.Bound(c => c.Id).Width(70);
            columns.Bound(c => c.Code);
            columns.Bound(c => c.Description);
            columns.Bound(c => c.CreationDate);
            columns.Bound(c => c.CreationUser);
        })
        .HtmlAttributes(new { style = "height: 534px;" })
        .Scrollable()
        .Sortable()
        .Selectable()
        .Pageable(pageable => pageable
            .Refresh(true)
            .ButtonCount(5))
        .DataSource(dataSource => dataSource
            .Ajax()
            .PageSize(15)
            .Read(read => read.Action("GetConcessoes", "MasterData"))
        )
    )
</div>


And the **script**:

<script type="text/javascript">
 
    $(function () {
 
        $('.tooltip2').click(function () {
 
            var id = this.id;
 
            $.get('@Url.Content("GetPartialView")',
            { "id": id },
            function (data) {
                $('#div-for-partial').html(data);
            });
 
        });
    });
 
</script>

This script sends the link's id (ic_open) to the controller successfully. I want to send the selected row data, via this same function or some other (doesn't matter), to the controller so I can manipulate that info.

CONTROLLER METHOD

public ActionResult GetPartialView(string id)
{
    switch (id)
    {
        case "":
            return PartialView("_Concessoes");
        case "tab1":
            return PartialView("_Concessoes");
        case "tab2":
            return PartialView("_AutoEstradas");
        case "ic_open":
            return PartialView("_NovaConcessao");
 
    }
 
    return RedirectToAction("Index");
 
}

Any help?
Thanks
Dimiter Madjarov
Telerik team
 answered on 06 Jan 2017
1 answer
213 views

I have a form with multiple combo boxes, all have the same OnSelect event.

When I call the OnSelect I need to determine which combo box actually fired the event.

 

Here is my OnSelect function...

function combo_OnSelect(e) {
        var dataItem = this.dataItem(e.item.index());
        var control =  $(this).val();
        if (dataItem.Value == "Lookup") {
            var dialog = $("#window_Lookup").data("kendoWindow")
            dialog.center().open();
        }
    }

The bolded part throws an error, so what is the correct way to determine the combo box name?

Ivan Danchev
Telerik team
 answered on 05 Jan 2017
12 answers
303 views

Hi Support Team,

I created a series starting on 2016/1/1 recurrence rule "daily" and repeat every 3 days. January and February are OK.

But in march ​there is an entry on 2016/3/28 and 2016/3/29.

When I change the series to repeat every 4 days the last correct entry is 2016/3/25. The next entry is on 2016/3/30.

This seems to be a general problem in daily recurrence.

Is there a hot-fix?

Regards, David

 

Dimitar
Telerik team
 answered on 05 Jan 2017
3 answers
233 views
When I use TimePicker it shows NaN on Mac but work perfect on Windows PC
Kiril Nikolov
Telerik team
 answered on 04 Jan 2017
2 answers
1.2K+ views

Hi,

 

I have a checkbox that should have a tooltip, but the tooltip never shows. Can you help me find what I am doing wrong? KeepComputer is (of course) a boolean.

            <tr>
                <td>@Html.Kendo().CheckBoxFor(m => m.KeepAccessBadge)</td>
                @Html.Kendo().Tooltip().For("#KeepAccessBadge").Content("Something...")
            </tr>

On other elements I have identical tooltips and they are working just as expected.

 

Henrik
Top achievements
Rank 1
 answered on 04 Jan 2017
1 answer
86 views

Is there a work around for select all items in a Autocomplete text box?

Thanks in advance!

Nencho
Telerik team
 answered on 03 Jan 2017
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
Dialog
MultiColumnComboBox
DropDownTree
Checkbox
Slider
Switch
Notification
Accessibility
ListView (Mobile)
Pager
Security
ColorPicker
DateRangePicker
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
SmartPasteButton
PromptBox
SegmentedControl
+? more
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?