Telerik Forums
UI for ASP.NET MVC Forum
1 answer
223 views
Hi. I am trying to implement the Kendo grid using adaptive rendering as I have an MVC view dedicated to mobile. When it renders, it behaves strangely in that the columns extend past the viewport and you must swipe to the right in order to see the columns. I'd expect the user to have to scroll like the HTML5 example. From what I see, there is no example using MVC but I'm using .Mobile() which is supposed to work I think. Please guide me in what I might need to do/provide an example using MVC. Thanks.
Craig
Top achievements
Rank 1
 answered on 21 Oct 2014
3 answers
2.1K+ views
I just upgraded my kendo grid with filterable options to the new GrodFilterMode.Row. In one of the fields I had a custom monthpicker where the could select a month, and that worked fine before i upgraded to the filter row. Now it is just a normal datepicker. It is set in the colums like this

col.Bound(x => x.WriteOffTo).Filterable(f => f.UI("dateFilter"));

and the javascript is 

function dateFilter(control) {
    $(control).kendoDatePicker({
        depth: "year",
        start: "year",
        format: "01.MM.yyyy",
        parseFormat : "01.MM.yyyy",
        close: function () {
            var picker = $(control).data("kendoDatePicker");
            var currentDate = picker.value();
            currentDate.setDate(1);
            picker.value(currentDate);
        }
 
    });
}

why does this break after i just added the line .Mode(GridFilterMode.Row) to .Filterable() ?
Petur Subev
Telerik team
 answered on 21 Oct 2014
2 answers
454 views
Hello,

I am using the Kendo Menu (through a bound site map, although the issue is also present if used through the helper class directly) and have noticed an issue with the menu calling our AuthorizationRoles attribute multiple times per item in the list.

Example:
There are 3 items in an example site map:
<siteMap>
  <siteMapNode  title="" description="">
    <siteMapNode title="Home" controller="Home" action="Index"></siteMapNode>
    <siteMapNode title="Person" controller="People" action="Person" >
      <siteMapNode title="Manage Person" controller="People" action="ManagePerson"></siteMapNode>
    </siteMapNode>
  </siteMapNode>
</siteMap>

The People controller is quite large and contains 64 public Actions which all has our Authorize Attribute.  Home has 0 Actions with Authorize Attributes.
For each load of the page, the Authorize attribute gets called 128 times for the menu alone.  Playing around with it, it gets called x times y amount where x is the number of methods with an authorize attribute in a given controller and y is the number of sitemap nodes referencing that controller.

Does anyone know if there is something I'm doing incorrectly or some way to fix the trimming so it only hits the action it's pointing to and not the entire controller for each item on the list?  We cache this item to speed it up, but in production it's making over 1000 calls to this function per page load and is quite intensive.

Current Razor used to generate the menu:
@(Html.Kendo().Menu()
        .Name("Menu")
        .Direction(MenuDirection.Bottom)
        .SecurityTrimming(true)
        .BindTo("WebSiteMap", (item, siteMapNode) => { })
)


Thanks for your help!
Georgi Krustev
Telerik team
 answered on 21 Oct 2014
1 answer
66 views
Hi,

In this demo http://demos.telerik.com/kendo-ui/grid/filter-row. is there a way to get the filter that was applied when user clicks on the filter icon and
selects a filter

Thanks,
Annie
Alexander Popov
Telerik team
 answered on 21 Oct 2014
6 answers
335 views
Hi,

I were trying the following things in the kendo grid and facing some issues,

1. Grid Tabbing

       Tabbing is working when there is no calculations are done on text changes. For example, if there are two fixed rows and first row is editable. If we change the data in the first row that should do a calculation and get updated in the second row. So for that purpose I use onCellChange event and i do the following in that

var grid = $('#gridtest').data("kendoGrid");
            var Row0 = grid.dataSource.data()[0];
            var Row1 = grid.dataSource.data()[1];

Row1.set("Total",Math.round(Row0.get("Total")*100)); 

These statement works and sets the value to the cell, but it is not visible until I focus  to the cell. To rectify this problem i used

grid.refresh();

This solves the issue, but it raises an another problem that i am unable to navigate to the next cell when i press tab. Due to this refresh the focus goes to first column. I need a solution for either to navigate to next cell when using grid.refresh() in oncellchange event or to display the cell when the value is set using model.


2. Dropdown Column

I have a dropdown column in the same grid where the model for that column has integer and i am unable to show the name in the cell instead of value.


I have attached a sample project with this and i have removed the packages folder in the attached project due to huge size, so please help me in this issue.

Thanks
Senthil

Tiago
Top achievements
Rank 2
 answered on 20 Oct 2014
1 answer
72 views
Hello,
    I'm relatively new to Telerik and I'm getting a bit stumped about what the best way to proceed is.

I have a grid running InCell mode, however, for a particular cell:

1. I need to pop a list of selections the user can pull from. These selections would then be appended to the text in the cell.
2. The user needs to retain the ability to type in the cell. (which I believe rules out using a multiselect instead)

To that end, I have a grid  with a  command button set up that displays a list of choices in a modal Kendo window using a partial view. You can see this in the attachment. I am trying to append the list of items to the "Comment" column in the main grid.

However, I'm still having issues doing the following:
1. Getting the selected id from the main grid and feeding this into the partial view so that the list shows the correct items for the main grid row.
2. Iterating through the rows in the partial view, getting the checked items and passing the data back to the main grid.

I'm going in circles with javascript and not getting the data back to the main grid.

So, I'm wondering if there is a simpler way to do what I'm trying to accomplish?

The most obvious one is to use the Mutiselect, but I don't think that satisfies the criteria of the user being able to type whatever they would like in addition to making choices.

If anyone has a better notion of how to approach this, please let me know.

Thanks,
Dave 


Petur Subev
Telerik team
 answered on 20 Oct 2014
6 answers
435 views
Hi

i'm using a Kendo UI Grid (Version: 2014.2.716.545) within a ASP .NET MVC 5 Project to bind XML Data from a local hosted REST Webservice. I would like to "activate" ServerPaging. Here is my Datasource Definition

var dataSource = new kendo.data.DataSource({
            serverPaging: true,
            serverFiltering: true,
            serverSorting: true,
            transport: {
                read: function (options) {
                    $.ajax({
                        url: ".../api/{Controller}/GetData",
                        type: "POST",
                        success: function (data) {
                            options.success(data);
                        },
                        error: function (errorThrown) {
                            alert(errorThrown);
                        }
                    });
                },
                create: function (options) {
                    SaveData(options);
                },
                update: function (options) {
                    SaveData(options);
                },
            },
            schema: {
                type: "xml",
                data: "/ArrayOfType/Type",
                model: {
                    id: "Type_ID",
                    fields: {
                        Type_ID: {
                            field: "Type_ID/text()", type: "number",
                            validation: { required: true }
                        },
                        FieldA: {
                            field: "FieldA/text()", type: "string",
                            validation: {
                                required: true,
                                min: 1
                            }
                        },
                        FieldB: {
                            field: "FieldB/text()", type: "string",
                        }
                    }
                }
            },
            pageSize: 50
        });

and my Controller Method:

[System.Web.Http.ActionName("GetData")]
        [System.Web.Http.HttpPost]
        public ResponseMessageResult GetData([DataSourceRequest] DataSourceRequest request)
        {
            try
            {
                var list = _db.Load().ToDataSourceResult(request);
                 
                var resp = ResponseMessage(new HttpResponseMessage(HttpStatusCode.OK)
                {
                    Content = new ObjectContent<DataSourceRequest>(list, new System.Net.Http.Formatting.XmlMediaTypeFormatter
                    {
                        UseXmlSerializer = true
                    })
                });
                resp.Response.Headers.Add("Access-Control-Allow-Origin", "*");
                return resp;
            }
            catch (Exception ex)
            {
                Logger.LogError(ex);
                throw;
            }
        }

The client calls the Controller Method correctly, but the request Parameter is always NULL. Is something wrong with my Client Definition ?
Philipp
Top achievements
Rank 1
 answered on 20 Oct 2014
1 answer
590 views
Hello, I'm having trouble setting up checkbox column in my grid. I am using inline edit mode and my checkbox column is se up like this

@(Html.Kendo().Grid<URBIS.ViewModels.PropisiViewModel>()
.Name("grid")
.Events(e => e.DataBound("onDataBound"))
.Columns(columns =>
{
 
    columns.Bound(p => p.GrupePropisa).ClientTemplate("#=GrupePropisa.Naziv#").EditorTemplateName("GrupePropisa").Width(220);
    columns.Bound(p => p.Naziv).Width(220);
    columns.Bound(p => p.SluzbeniList).Width(220);
    //columns.Bound(p => p.Aktivan).Width(120);
    columns.Bound(p => p.Aktivan)
              .Title("Aktivan")
              .ClientTemplate("<input type='checkbox' #= Aktivan ? checked='checked': '' # class='chkbx' />")
              .HtmlAttributes(new {style = "text-align: center"})
              .Width(50);
})

and script handling check events is
$(function () {
    $('#grid').on('click', '.chkbx', function () {
        var checked = $(this).is(':checked');
        var grid = $('#grid').data().kendoGrid;
        var dataItem = grid.dataItem($(this).closest('tr'));
        dataItem.set('Aktivan', checked);
    });
});

The problem I'm experiencing is very weird. Binding to bool field from database works fine, editing also but when inserting, checkbox always passes as false. Very weird. Also, I would like the checkbox to be disabled if the row is in read only mode and to be editable if the row is in edit/insert mode. Any help? Lost few hours on this and this is too much :)
Alexander Popov
Telerik team
 answered on 20 Oct 2014
2 answers
406 views
In the past, with the AngularJS.KendoUI nuget package I was able to mix both AngularJS style kendo instantiation with traditional Html.Kendo() instantiation.

With the latest version Kendo UI v2014.2.716 the bridge is now integrated.

Today I created a brand new project added Kendo UI v2014.2.716 .  Added <html ng-app="marketing">
with     <script>
        angular.module('marketing', []);
    </script>

and noticed that the traditional instantiation is broken.
"TypeError: m is not a function"


Attached are images with ng-app and without ng-app behavior.


Nik Ivancic
Top achievements
Rank 1
 answered on 19 Oct 2014
2 answers
636 views
I have a problem with Kendo Pie chart about "Aggregate" functions(count, sum, average).Everyting works with Bar or Column chart but when i try to show pie chart i can't use count, sum, average functions of Kendo Pie Chart's.

I can show my values invidually but i can't group my values(like euro, dolar, lira)How can i group my values and show them with Pie chart?

Here is my model:
public decimal MoneyValue{ get; set; }
public string MoneyName{ get; set; }

My values are coming like that with Pie Chart.:
Euro - 10
Dolar- 100
Dolar - 50
Euro -15
Dolar - 50
Lira - 45

I need to show values like that:
Euro - Count: 2 Total:25 Avg: 12,5
Dolar - Count: 3 Total: 200 Avg: 66,6
Lira Count: 1 Total: 200 Avg: 200

View Code


View Code@(Html.Kendo().Chart(Model)
.Name("chart")
.Title(title => title
.Text(@ViewBag.a)
.Position(ChartTitlePosition.Top))
.Legend(legend => legend
.Visible(false)
.Position(ChartLegendPosition.Top))
.Series(series =>
{
series.Pie(model => model.MoneyValue, categoryExpression: model => model.MoneyName);
// .Aggregate(ChartSeriesAggregate.Count)
//.Labels(labels => labels.Visible(true).Position(ChartBarLabelsPosition.Center));

//here i get the error. It shows there is no .Aggregate function so i can't group my values.

})


.Theme("metro")
.Tooltip(tooltip => tooltip
.Visible(true)
.Template("#= category #: #= value #"))
.Events(ev => ev.DataBound("onDB"))

)

Kendo Count - Sum - Average functions:(i've no problem with them, they work correctly.)<div class="configuration-horizontal">

<div class="config-section">
<center>
<span class="configHead">Grafik </span>
</center>
<ul class="options">

<td>
<input id="aggregateSum" name="aggregate" type="radio" value="sum" autocomplete="off" />

Sum

</td>
<td>
<input id="aggregateAvg" name="aggregate" type="radio" value="avg"
autocomplete="off" />

Avg

</td>
<td>
<input id="aggregateCount" name="aggregate" type="radio" value="count" checked="checked" autocomplete="off" />

Count

</td>
</ul>

</div>
</div>
<script>
$(".configuration-horizontal").bind("change", refresh);

function refresh() {
var chart = $("#chart").data("kendoChart"),
series = chart.options.series,
categoryAxis = chart.options.categoryAxis,
baseUnitInputs = $("input:radio[name=baseUnit]"),
aggregateInputs = $("input:radio[name=aggregate]");

for (var i = 0, length = series.length; i < length; i++) {
series[i].aggregate = aggregateInputs.filter(":checked").val();
}

categoryAxis.baseUnit = baseUnitInputs.filter(":checked").val();

chart.refresh();
}
</script>
Gokhan
Top achievements
Rank 1
 answered on 17 Oct 2014
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
Wizard
Security
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
+? more
Top users last month
Bohdan
Top achievements
Rank 3
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Elliot
Top achievements
Rank 1
Iron
Iron
Iron
Sunil
Top achievements
Rank 1
Cynthia
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Bohdan
Top achievements
Rank 3
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Elliot
Top achievements
Rank 1
Iron
Iron
Iron
Sunil
Top achievements
Rank 1
Cynthia
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?