Telerik Forums
UI for ASP.NET MVC Forum
4 answers
63 views

I have a MVC grid and it seems that if I pick a column to sort it actually sorts the column to the right.

 Below is my razor code.  Not sure why this is happening.

 

Thanks,

Matthew

@(Html.Kendo().Grid(Model)
.Columns(columns =>
{     columns.Bound("").Locked(true).Filterable(true).Sortable(false).ClientTemplate("imagePath;").Width(75).Title("").Groupable(false);;      columns.Bound(c => c.Code).Title("Code");
columns.Bound(c => c.ShortName).Title("ShortName");
columns.Bound(c => c.Name).Title("Name");
columns.Bound("").ClientTemplate("#=Description#, #=Comment#).Title("Desc");columns.Bound("").Locked(true).HtmlAttributes(new { @class = "k-group-cell" }).Width(60).Title("").Filterable(false).Sortable(false).Groupable(false).ClientTemplate();
})
.Groupable()
.Filterable()
.Selectable(selectable => selectable.Mode(GridSelectionMode.Single).Type(GridSelectionType.Cell))
.Sortable(sortable => sortable
 .SortMode(GridSortMode.MultipleColumn))
.Pageable(pageable => pageable
.Refresh(true)
.PageSizes(true)
.ButtonCount(5))
.DataSource(dataSource =>dataSource
 .Ajax()
 .Sort(sort => sort.Add("Code").Ascending())
 .PageSize(50)
 .ServerOperation(false)
)
)

Paul
Top achievements
Rank 1
 answered on 28 Jul 2015
2 answers
293 views

Hi, I am using Kendo for ASP.Net MVC version 2015.2.264

I am trying to set the selected value of a dropdown list programatically via javascript as follows, but it always returns null:

        var ddl = $("#selDFTAlignment").data("kendoDropDownList");
        if (ddl == null) { alert('null ddl'); return; }
        ddl.select("1");​

 

I use the MVC wrappers to define the dropdown which generates the dropdown script as follows:

jQuery(function(){jQuery("#selDTFAlignment").kendoDropDownList({"dataSource":[{"Text":"Left","Value":"0"},{"Text":"Centre","Value":"1"},{"Text":"Right","Value":"2"}],"dataTextField":"Text","template":"\u003cspan\u003e#:data.Text#\u003c/span\u003e","valueTemplate":"\u003cspan\u003e#:data.Text#\u003c/span\u003e","dataValueField":"Value"});});

 

The dropdown list is inside a div container for a modal popup:

<div id="mdlDefaultText" class="modal fade" role="dialog">​

 

Why is the selector not working?  Am I missing something?  

David
Top achievements
Rank 1
 answered on 28 Jul 2015
2 answers
97 views

I've run into a rather specific bug that only occurs when using the MVC helper - an equivalent grid created using Javascript works as expected. This is using Kendo UI v2015.2.624 (Kendo MVC 2015.2.624.545) and is non-browser-specific (reproed in Chrome, Firefox, and IE). 

In a grid in batch edit mode, grouped by a column, with some frozen columns, the delete command button will only ​delete some of the columns in the row it's in. If the delete button is locked (and thus in the locked column section) it will only delete the locked columns for that row; if it's an unlocked column, it will only delete the unlocked columns. You have to Cancel Changes, or Save Changes and refresh the grid, to get both sides to match again.

I've attached a picture showing the error. I also have a test MVC project with two equivalent grids - one created with the MVC helper, one created with Javascript. (I can't attach it because it's 16MB when zipped, and the maximum attachment size is 2MB.) The MVC helper grid displays this error, and the Javascript grid does not. Both grids have a locked and unlocked delete button to show how it only deletes each section in the MVC grid. The delete function is only a stub, so Save Changes doesn't work, but it's not needed to display the bug.

I'm sure I could hook into an event and hide the rest of the row myself, but I'm not sure I should have to, since the javascript grid works well. Is this a known bug? Is there an existing workaround? 

Vladimir Iliev
Telerik team
 answered on 28 Jul 2015
2 answers
100 views

I am evaluating Telerik ASP.NET MVC for a small shop of C# developers with minimal to no javascript background. In particular the DropDownList event demo (but the same problem applies to many of the demos). The demo link here:

http://demos.telerik.com/aspnet-mvc/dropdownlist/events

Now a typical use case for this component for an ASP.NET MVC developer would be to:

1.Load the DropDownList from an MVC Controller

2. Detect a selection changed event

3. Do something with the selected value in an MVC context, such as having an ActionLink in a Razor view to pass the selected item back to the mvc controller as an action param, or calling a GET on an MVC controller from JavaScript with the selected value in order to demonstrate the "full round trip"

 Instead these demos show the bare minimum (outputting to client side log). It would be nice for these demos go the extra mile to show some real non-trivial use-cases in the example code. Sure, you can find the answer to the above stuff by spending half a day in the forums hoping someone else had the same question and searching stackoverflow, etc, but for us the quality and depth of the example code will be the deciding factoring in purchasing a license, thanks

 

 

 

 

UM
Top achievements
Rank 1
 answered on 28 Jul 2015
3 answers
208 views
I've two columns in my Grid . on first column i want divide by 2 operation and on the second i want that if the value is greater than zero then a local variable value is green
Viktor Tachev
Telerik team
 answered on 28 Jul 2015
10 answers
706 views
I have a page where i use MVC validation when I click on submit on my form.  basically it uses:

@using (Html.BeginForm("InsertData", "DataPage", FormMethod.Post, new { enctype = "multipart/form-data" }))
{
    @Html.ValidationSummary(false, "Insert Data unsuccessful.")
...

one of the fields inside this form is:

@Html.Kendo().DropDownListFor(m => m.DType).BindTo(Models.DType.GetDTypes())

This DType business object has the [Required] data attribute on it,and it works great the first time.  If i select a DType from the dropdown, then the submit works fine.  if i don't select it, then i get a validation error in the summary above telling me i need to enter a value.

Great, no problems so far.  The problem though is now i have a validation error, so i correct it on the form by selecting a DType.  This does nothing.  I click submit, it tells me i still haven't entered a DType value.  Putting a breakpoint in the controller confirms that it's not recieving a DType value, despite the fact that i selected one.

If i change the dropdown to a basic @Html.DropDownListFor ... , it works fine, so i know the problem is with the kendo control.  What am I doing wrong here, and how can i fix it?  
Thanks

Georgi Krustev
Telerik team
 answered on 28 Jul 2015
1 answer
984 views

Hi, 

I want to use custom button in kendo grid toolbar which work as save changes button (i.e send edited list of rows),

I have a grid which has a checkbox column "Select"  , so when the checkbox is checked the row comes in edited state, and by simply pressing the Save Changes button I could send edited rows to controller method.

But problem is that I need two buttons (i.e ​Approve and Reject which needs to work same as the "Save Changes" button does) to do different tasks on selected records.

 

Attached here is snapshot.

Radoslav
Telerik team
 answered on 28 Jul 2015
1 answer
170 views
I have tooltips that I'm trying to initialize and I can't get it to work on the initial load of my view. The function is firing but it seems like the events have not been created yet on the DOM so I'm not able to attach a click event to them. I'm using a custom template with a class ".app". I'm doing a $('.app').each to find all my events on the scheduler. If I click one of the views or reload it with a button click it works. just when it officially loads for the first time. Any help would be great.
Bozhidar
Telerik team
 answered on 28 Jul 2015
1 answer
95 views

Hi,

 

I have a grid with several ForeignKeyColumns.

In IE11 when I click on a column the dropdown opens (for a blink) - the input moves a bit - and after that it works as expected.
I can also Tab through the fields - if I focus them first they move a bit (without opening) and after it they work normal.

In chrome the "initial moving and ''blink' opening" does not occur.

This only happens in IE when the column is to small to display the whole dropdown.

 

Rosen
Telerik team
 answered on 28 Jul 2015
2 answers
58 views

Hi,

I use a MultiSelect to choose several values in an m:n relation.

Everything works as expected as long as I select one or more values.
But when I select nothing I get the following error:

0x800a138f - Laufzeitfehler in JavaScript: Die Eigenschaft "length" eines undefinierten oder Nullverweises kann nicht abgerufen werden.

The failing code is for(n=0,i=e.length;i>n;n++)o+=n%2?s(e[n]):a(e[n]),r._data.push(e[n]);return o}

This happens only when I add a new record.
If I edit an existing one it is possible to remove the formerly chosen element and update after this.

I initialize the field via model.Field(p => p.Salads).DefaultValue(new List<EECanteen.Models.FoodItem>());

To explain my problem - I want to edit meal offerings for a day and can choose from zero or more salads.

ManniAT
Top achievements
Rank 2
 answered on 27 Jul 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?