Telerik Forums
UI for ASP.NET MVC Forum
1 answer
210 views
Hello,
after some initial test with Kendo UI and the reading  a book of Freeman about MVC I've decided to put struff toghether... but I've still some hiden point I've to finish analyzing...

First : Does Kendo UI supports Entity Framework (in the specific case IdeaBlade's Devforce implementation)? I've tried with a single Entity and it was ok, added a relational one and the view doesn't load data anymore...

Second: I've read I can use the Async ActionResult for MVC ...beign a fan of It I was wondering how should I load the data with KendoUI , consider for example this ActionResult

    public async Task<ActionResult>  GetClientiAsync([DataSourceRequest]DataSourceRequest request)
        {
            IQueryable<I_CLIENTI> dataResult = await  clientiRepository.GetAllClientiAsync();
            DataSourceResult res = dataResult.ToDataSourceResult(request);

            return Json(res, JsonRequestBehavior.AllowGet);
        }
Third : On the book I've seen it uses the View(<model>)  returned... in some of your example you use Json to return data passing [DataSourceRequest] and as far I've understood it's in order to bind the kendo object on the View... What have I to use so?

Thanks
Petur Subev
Telerik team
 answered on 09 Aug 2013
4 answers
412 views
hi

i have some specific requiremnet for client... i have to diplay company name on top of ther page and detail in below portion.

i use normal html control on top page and Kendo grid in detail portion. but i don't know how to pass whole model on controller on save.
my model is like below...

public class Company 
     {
        public string Company { get; set; }
        public IEnumerable<Person> Clients { get; set; }
    }

  public class Person
    {
        [UIHint("Integer")]
        public int PersonID { get; set; }
        [Required]
        public string Name { get; set; }
    }


on view page i declare model like this
@model  MyData.Company 
////////
//
@using (Html.BeginForm())
{  
    @Html.EditorFor(x => x.Company);

////

Kendo grid

 @(
        Html.kenogrid(Model.Person)///////

can you please help me or give sample working application based on my this model.


it will vary help full me to develop my mvc application with this control



thanks




javal patel
Top achievements
Rank 1
 answered on 09 Aug 2013
1 answer
328 views
Hi,

I have just installed the Kendo UI for ASP.NET MVC extensions into my VS 2012 and have a small issue.  It seems in general to have installed ok but when I try to create a Kendo project and I'm shown the Project Configuration Wizard, the drop down box directly underneath the Kendo UI for ASP.NET MVC Project Settings title is empty.  When I click on the download button I get a dialogue box saying "Error retrieving latest version information. Please, try again or contact the Telerik team."

Have I done something wrong?  I'm a bit of a newb at this so any pointers would be greatly appreciated.

Thanks.
Jonathan.
Vesko
Telerik team
 answered on 09 Aug 2013
3 answers
94 views
I have 12 calendar on 2 <TR> in my view (6 calendars/TR)
I need the calendar smaller so they all have the style :     .calendar {width: 150px;   height: 200px;}

@(Html.Kendo().Calendar().Name("YearCalendarMay")
.Min(new DateTime(Model.Year.Year,5,1)).Max(new DateTime(Model.Year.Year,5,31))      
 .Footer(" ").MonthTemplateId("cellTemplate").HtmlAttributes(new { @class = "calendar" })                             
        )


I have the problems shown in the picture,probably because I set the Min and Max properties  :

http://img825.imageshack.us/img825/5164/iud2.png


And I try as you suggested to disable the click on title navigation but I'm missing something

$(document).ready(function () {
        $("YearCalendarMay.k-nav-fast").off("click").css("cursor", "default");
        $("#YearCalendarMay.k-nav-fast").on("click", false);
    }); 

I will appreciate some if you can help me please ..
Dimo
Telerik team
 answered on 09 Aug 2013
2 answers
173 views
Hello again,
Can i add checkbox as a column header ,and also as a column in the grid?
and when i check that header column,it checks every row,something like delete all in the yahoo mail,or hotmail?

Thanks in advance for any suggestion,
Regards Daniel
Daniel
Top achievements
Rank 1
 answered on 09 Aug 2013
0 answers
83 views
I just created my own ViewModel for setting up a Line Chart that I configure with the appropriate settings, AJAX Controller, Action, Event javascript functions, Series Names, etc.  This is so I can easily configure the charts and send them to a common line chart partial page.  This seems to work well for me given that I've got a dashboard page with many charts on it and this seems to be a cleaner (and more flexible) way to do it compared to hardcoding each chart and its setup individually (iterate over the collection of ViewModels and create chart partial page for each one).  I was thinking that it would be nice if Kendo had something like this for us to we wouldn't have to create it ourselves.

My next task is the grid and clearly, there is a lot of complexity there.  I'm hoping I can reuse something that already exists.

Thanks in advance.
Ed
Top achievements
Rank 1
 asked on 08 Aug 2013
3 answers
333 views
My Kendo grid is not Ajax binding.  My code mimics what is in your examples exactly, so I can't see the problem.
The grid:
@(Html.Kendo().Grid<LedgerEntryViewModel>()
 .Name("grdItems2")
 .DataSource(datasource => datasource
 .Ajax()
 .Read(read => read.Action("GeneralLedgerEntries", "GL").Data("gridBindingData"))
 .PageSize(10)
 )
 .Columns(col =>
 {
col.Bound(c => c.AccountingEventName).Title("Accounting Event").HtmlAttributes(new {style = "white-space:nowrap;width:50%;"});
 })
 .Sortable()
 .Pageable()
 )

I can see in Fiddler that the controller code is returning the correct JSON to the page: 
public ActionResult GetEntries(string accountType, int? categoryID, int? accountID, int? year, int? month,
 [DataSourceRequest]DataSourceRequest request)
 {
var list = new List<LedgerEntryViewModel>();
 
list = _gridHelpers.GetAccountEntriesWithRunningTotal(accountType, accountID.Value);
 
DataSourceResult result = list.ToDataSourceResult(request);
var json = Json(list, JsonRequestBehavior.AllowGet);
 return json;
 }    
Daniel
Telerik team
 answered on 08 Aug 2013
1 answer
91 views
I have a grid that is filterable. It has two columns:
.Columns(columns => {
    columns.Bound(customer => customer.CustomerName).Title("Customer Name");
    columns.Bound(customer => customer.CustomerStatus.CustomerStatusName).Title("Status");
})
CustomerName filters without problems. However, when you attempt to filter on CustomerStatus.CustomerStatusName, the DataSourceRequest object posted back has the FilterDescriptor.Member = "undefined".

We do have kendo.aspnetmvc.min.js referenced. And we're using the lastest release 2013.2.716.
Nicholas
Top achievements
Rank 1
 answered on 08 Aug 2013
3 answers
211 views
My previous post went unanswered and had to figure it out myself (so much for premium support), but eventually got it figured out. Now I am stuck again - with the same stupid widget.
$999 for half working widgets, basic documentation and no support is starting to seriously get to me.

Anyway, I am populating my Multiselect widget with a list of Weighbridges. This part works fine. I can also select weighbridges with no problem.
When I post back to the controller, the model reflects the number of items I selected in the Multiselect, but the data is either null (for strings) or 0 (for ints).

Controller populating the ViewBag
ViewBag.Weighbridges = dbDataService.ToLookUp<Weighbridge>();
My Lookup class
public class LookupEntity : ILookupEntity
{
    public int Id { get; set; }
    public string Description { get; set; }
}
Widget implementation
@(Html.Kendo().MultiSelectFor(model => model.Weighbridges)
                      .Name("Weighbridges")
                      .DataTextField("Description")
                      .DataValueField("Id")
                      .Value(Model.Weighbridges)
                      .Placeholder("Select weighbridges...")                
                      .HtmlAttributes(new {style= "width:310px"})                     
                      .AutoBind(true)
                      .BindTo((IEnumerable<LookupEntity>)ViewBag.Weighbridges)
                )
My UserModel class with the portion of interest.
[DisplayName("Assigned Weighbridges")]
public IEnumerable<LookupEntity> Weighbridges { get; set; }


Upon posting back to the controller, the rest of the model details are 100%. My Weighbridges property shows the number of items that were selected in the Multiselect, but none of the values are set.

I am using the Multiselect in a popup editor for grid editing.

Can someone help? And today please. I have wasted 2 full working days trying to get the Multiselect to work. KendoUI is supposed to boost productivity surely?









DominionZA
Top achievements
Rank 1
 answered on 08 Aug 2013
1 answer
228 views
I would like to update the parent grid when the child grid record is updated, is that possible?  If so could anyone provide any advice on it?  

Firstly I'm not sure which event would be best to use on the child grid. I want the child grid's CRUD action to fire, then load the contents of the parent again, preferably by Ajax.

Below is my grid as is:

@{
    ViewBag.Title = "Bills: Parent/Child";
}
 
<h2>Bills Index</h2>
 
@(Html.Kendo().Grid<BillParent>()
    .Name("BillParentsGrid")
    .Columns(columns =>
    {
        columns.Bound(h => h.Category);
        columns.Bound(h => h.Description);
        columns.Bound(h => h.Amount);
        columns.Command(command =>
        {
            command.Edit();
        }).Width(95);
    })
    .DataSource(dataSource => dataSource
        .Ajax()
        .Model(model =>
        {
            model.Id(h => h.BillId);
            model.Field(h => h.BillId).Editable(false);
        })
        .Events(events => events.Error("error_handler"))
        .Read(read => read.Action("BillParents_Read", "Bill"))
        .Update(update => update.Action("BillParent_Update", "Bill"))
    )
    .Events(events => events.DataBound("dataBound"))
    .ClientDetailTemplateId("BillChildren")
 
      )
 
<script id="BillChildren" type="text/kendo-tmpl">
    @(Html.Kendo().Grid<BillChild>()
          .Name("BillChildren_#=BillId#")
          .Columns(columns =>
          {
              columns.Bound(d => d.BillId).Width(50);
              columns.Bound(d => d.Description).Width(150);
              columns.Bound(d => d.Amount).Width(80);
              columns.Command(command =>
              {
                  command.Edit();
                  command.Destroy();
              }).Width(55);
          })
          .DataSource(dataSource => dataSource
              .Ajax()
              .Model(model =>
              {
                  model.Id(d => d.BillId);
                  model.Field(d => d.BillId).Editable(false);
              })
            .Events(events => events.Error("error_handler"))
            .Read(read => read.Action("BillChildren_Read", "Bill", new { id = "#=BillId#" }))
            .Update(update => update.Action("BillChild_Update", "Bill"))
            .Create(create => create.Action("BillChild_Create", "Bill", new { id = "#=BillId#" }))
            .Destroy(destroy => destroy.Action("BillChild_Destroy", "Bill")))
           
          .ToolBar(tools => tools.Create())
          .ToClientTemplate()
          )
</script>

Many thanks.
Petur Subev
Telerik team
 answered on 08 Aug 2013
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?