Telerik Forums
UI for ASP.NET MVC Forum
7 answers
113 views
I may be missing something obvious here, but how was the Unit Price NumericTextBox with a minimum of 1 accomplished on the demo at http://demos.telerik.com/aspnet-mvc/grid/editing-custom ?  I only see one mention of UnitPrice in the example code
columns.Bound(p => p.UnitPrice).Width(120);
but surely that's not all there was to it.  When I view the demo page's source I also see a kendo.data.DataSource being created with:
UnitPrice: { type: "number", validation: { required: true, min: 1} }
but it still seems like there would be something else going on in the @(Html.Kendo().Grid definition to make the editor use a NumericTextBox over just a plain textbox.

Is there anything else going on, and if so, where can I find the details?  I'm not seeing any more information in the local demo project either, but I might just be looking in the wrong place.  Or is there a better demo example I can look at that shows how to do just the NumericTextBox in a grid?
Kevin
Top achievements
Rank 1
 answered on 19 Mar 2015
1 answer
143 views
How can I set my treelist to expanded state by default ?
Alex Gyoshev
Telerik team
 answered on 19 Mar 2015
3 answers
273 views
Hi,

We need to set different colors for different events based upon a status value (Approve/Reject) dynamically.
We tried the sample on your site. 
.Resources(resource =>
{
resource.Add(m => m.OwnerID)
.Title("Owner")
.DataTextField("Text")
.DataValueField("Value")
.DataColorField("Color")
.BindTo(new[] {
new { Text = "Alex", Value = 1, Color = "#f8a398" } ,
new { Text = "Bob", Value = 2, Color = "#51a0ed" } ,
new { Text = "Charlie", Value = 3, Color = "#56ca85" }
});
})
But our requirement is to load datasource for resource dynamically with StatusId and StatusColor.

Thanks,
Jazeel
Vladimir Iliev
Telerik team
 answered on 19 Mar 2015
4 answers
704 views
Hi

I'm trying to reproduce the custom editing sample with dropdownlist inside the gridcell.
For some reason, the combo is not created...

I'm attaching the project to this message.

Do I miss any script for the project?

Thank you in advance,
Shabtai
Vladimir Iliev
Telerik team
 answered on 19 Mar 2015
3 answers
136 views
I am using AutoComplete where users can search for different type of data in one field like search in gmail or IMDB. In my case I would like to search for employees and departments. If the keyword matches both I have to display all the results. Below is the example format I want to display.

Emp Id   Name
123        test
124        test 1

Dept Id   Dept Name
123         Dept1
124         dept 2

how can I use two header templates?
Georgi Krustev
Telerik team
 answered on 18 Mar 2015
1 answer
74 views
Please help me to find checked items from hierarchy grid...i need few rows from parent tables as well as few from child tables..
Dimiter Madjarov
Telerik team
 answered on 18 Mar 2015
1 answer
209 views
I have an edit view which has a couple properties, plus an array of child objects.  The view uses a tabStrip for those child objects, one tab page per child.  Those child objects have a couple properties, and also an array of grandchild objects that are displayed in a grid.

I'm using a partial view to display the child object properties and the grandchildren grid.

The content of the tabStrip pages is defined by:

.Content(Html.PartialFor(model => model.Children[i], "_TheChildPartialView").ToHtmlString());

That provides the automatic prefixing of the child object's controls with "Children[(index)]", such as name="Children[0].SomeChildProperty", which is perfect.

But this causes a problem on the grid for the grandchildren.  When I click in a cell to edit it, the input that is created is given name="Children[0].SomeGrandchildProperty".  The input textbox is not given the value that was already in the cell, and when I leave the edit cell after changing the value the error is raised "Uncaught TypeError: Cannot read property '0' of undefined" which is shown to be coming from this code (looks like it is in C.extend.set of kendo.all.min.js):

(function(d
/**/) {
return d.Children[0].SomeGrandchildProperty
})

I'm naming the grid on the partial view with .Name("GrandchildrenForChild" + Model.Index), so that eliminates conflicts with the grid itself from having multiple grids on the page.  But I don't know how to do deal with the automatic prefix causing problems in the edit cells of the grid.  Anyone have ideas how to handle that?
Daniel
Telerik team
 answered on 18 Mar 2015
3 answers
320 views
Hello,

in our MVC 4 application we use a Kendo grid with the following configuration:

@(Html.Kendo().Grid(Model)
.Name("GridAddDrive")
.Columns(columns =>
{
columns.Bound(m => m.Type1Name);
})
.Navigatable()
.Selectable(selectable => selectable.Mode(GridSelectionMode.Single).Type(GridSelectionType.Row)).Events(events => events.Change("selectionChange"))
.Pageable()
.Scrollable()
.Sortable()
.DataSource(dataSource => dataSource
        .Ajax()
        .ServerOperation(false)
    )
)

When you now open the view which contains the grid and click a header of the column to sort it, you will be redirect to the link in the href of the column header.
The href in the header looks like this:

http://localhost:50107/ProjectDrives/AddDriveDialog?_=1369648574797&GridAddDrive-sort=Type1Name-asc

The question now:
Why the href of the column header contains this link? 
Other views which also contains a grid, the problem does not exist. In these views the href only contains a "#" and not a URL. A difference between the views is that these with the "#" in the href uses ajax to load data.

When searching for a solution we have found this article http://www.kendoui.com/forums/ui/grid/grid-sorting-problem.aspx, but the proposed solution seems to make no sense, because we have included all the files and in addition to that the functionality is given on other views.

Do you have another idea for a solution or suggestion to suppress the content of the href?

Kind Regards,
Peter Kaiser
Vladimir Iliev
Telerik team
 answered on 18 Mar 2015
4 answers
132 views
Have several different grids in my web site with add/update functionality, and they worked fine with kendo mvc version 2012.2.1002.  Since then, i have tried upgrading to 2012.3.1114, 2012.3.1121, and 2012.3.1210.  All work in most ways EXCEPT for add/update.  The 'update' function works fine if the objects populating the grid is not complicated.  A list of strings or something.  It seems like if the class is more complicated, in my case it inherits from an abstract class, and i get the following error every time i try to update a row via the
ds.Ajax().ServerOperation.Update:
Cannot create an abstract class. Type = System.MissingMethodException

Additionally, the 'add' functionality has also broken
 If i try this with a simple call, works great.  If i try this with something like:
ds.Ajax().ServerOperation.Create(create => create.Action("_AddDetail""SituationBoard"new { area = "Tools", id = @Model.ProjectGUID, 
SitBoardGUID= @Model.SitBoardGUID}));

My 'SitBoardGUID' value never gets passed to the controller (appears as null).  This line seems to translate to the following html:
<a class="k-button k-button-icontext k-grid-add" 
href="/CoBRAMVCPortal/Tools/SituationBoard/_GetDetailList/00000000-0000-0000-0000-000000000000
?SitBoardGuid=f2135c76-9769-4536-92ea-37c352ebf431
&amp;f2135c76-9769-4536-92ea-37c352ebf431_grid-mode=insert">

notice the SitBoardGUID value is entered twice, separated by a &amp; for some reason. That seems to be
causing the issue. Any guidance on when this will be fixed? It's somewhat worrisome that you've had 3 releases
and this is broken in all 3 of them.
Remember, all of these functions still work if i revert back to the 2012.2.1002 build.
Kelso
Top achievements
Rank 1
 answered on 17 Mar 2015
12 answers
1.0K+ views
Hi,

Need help to find the best way to apply filter in links - or a different method if that's better.

This is what I want.
I have a page that shows a lot of names, and when clicking on a name, another page should appear showing details for that particular name.
My initial thought was, that this is done by filtering, right !!
Using filters, also allow the user to cancel the restrictions or change filter options, if desired.
I still think this is the right way, I just don't know how.

I have played around with action links:
...ClientTemplate(@Html.ActionLink("#=Company.Name#", MVC.Company.ActionNames.Index, MVC.Company.Name, new { id = "#=Company.Id#" }).ToHtmlString());
-which gives the following URL: "http://localhost:65398/Company/Index/12345".
It would then be possible to save this ID in a session variable and then load it when the AJAS request arrive and then apply the extra FilterDescription to the list of filters, but it's still a hack.

I guess I have to find a way to add the filter parameters to the URL so kendo grid recognize it as a filter.
Any help would be appreciated.
Thanks.
Vladimir Iliev
Telerik team
 answered on 17 Mar 2015
Narrow your results
Selected tags
Tags
+? more
Top users last month
Anislav
Top achievements
Rank 6
Silver
Bronze
Bronze
Jianxian
Top achievements
Rank 1
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Jim
Top achievements
Rank 2
Iron
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Anislav
Top achievements
Rank 6
Silver
Bronze
Bronze
Jianxian
Top achievements
Rank 1
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Jim
Top achievements
Rank 2
Iron
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?