Telerik Forums
UI for ASP.NET MVC Forum
1 answer
213 views
Hi,

In my app, I have a scheduler that I try to fill using  the DataSource.Read but it stay empty.
I verified the data arrives to the client but it seems not to be understand by the control.
Here's a bit of code:

@(Html.Kendo().Scheduler<xxx.Website.Models.Lesson>()
    .Name("scheduler")
    .Date(new DateTime(2014, 12, 12))
    .StartTime(new DateTime(2014, 12, 8, 9, 00, 00))
    .EndTime(new DateTime(2014, 12, 5, 14, 00, 0))
    .Height(700)
    .AllDaySlot(false)
    .Views(views =>
    {
        views.WeekView();
    })
            .Resources(resource =>
              {
                  resource.Add(m => m.LessonType).Title("Lesson Type").DataTextField("Text").DataValueField("Value").DataColorField("Color").BindTo(new[]{
                  new { Text = "Group1", Value=1, Color="#DC8166"},
                  new { Text = "Group2", Value=2, Color="#889DAE"},
                  new { Text = "Group3", Value=3, Color="#91DE80"},
                  new { Text = "Group4", Value=4, Color="#FFD24D"}
          });
              })
    .Timezone("UTC")
  .Editable(false)
        .DataSource(d => d
                .Model(m =>
                {
                    m.Id(f => f.Id);
                    m.Field(f => f.Title).DefaultValue("No title");
                })
                .Read(read => read.Action("Read_Scheduler", "Administration").Data("getDates"))
)
)

I already use a scheduler on another page but using the BindTo method which work just fine.
Here I need to call server to update the scheduler when the user change displayed the week.

What do I miss ?

Regards,

David
Georgi Krustev
Telerik team
 answered on 19 Dec 2014
1 answer
162 views
Hi,
I am upgrading from Telerik extensions. The code used to open a window and set the datasource for the grid on that page was:

function openTrainWind(trainID) {
            var window = $("#trainWindow").data("kendoWindow");
            window.ajaxRequest("/Trains/_Trains/", { _trainID: trainID });
            window.center().open();
        }

The code has been upgraded to work with Kendo but produces the error "Uncaught TypeError: undefined is not a function"
How would this code need to change to work with Kendo.

Thanks
Neil
Top achievements
Rank 1
 answered on 18 Dec 2014
3 answers
112 views
Hello,

I have been trying to get the batch grid to work with a file upload. The aim is to update the grid with the information in the text file. Would this be a common scenario which has been tried before? 

For temporary solution, I processed the uploaded file and save it in the server and render the partial view which contain
@html.Kendo().Grid()

Then, during loading of the partial view, the Read( read.Action ("Test","TestController")) is invoked and load the data from the text file.

Is there a way to set the dirty flag manually after the initial load of the grid so that I can click the save button?

Thank you,

-sk 
Dimiter Madjarov
Telerik team
 answered on 18 Dec 2014
2 answers
680 views
I have a situation, in which the Kendo().DropDownListFor isn't working as expected; I'm using a dropdown in a KendoGrid edit popup. The user is allowed to choose a user friendly value for a foreign key.

This is working:

@Html.DropDownListFor(m => m, new SelectList(ViewBag.Partners, "Id", "FriendlyName"), "Select Partner")

But this is not:

@(Html.Kendo().DropDownListFor(m => m)
    .BindTo(new SelectList(ViewBag.Partners, "Id", "FriendlyName"))
    .OptionLabel("Select Partner"))

In both cases, the dropdown is displayed correctly, and the initial value is correctly selected.
However, when saving, the Id field is cleared. When I look at the generated HTML markup, this is a part of it:

<ul unselectable="on" class="k-list k-reset" tabindex="-1" role="listbox" aria-hidden="true" id="PartnerId_listbox" aria-live="off" style="overflow: auto; height: auto;"><li tabindex="-1" role="option" unselectable="on" class="k-item">Select Partner</li><li tabindex="-1" role="option" unselectable="on" class="k-item">Indicia Test SFTP</li><li tabindex="-1" role="option" unselectable="on" class="k-item">Indicia Test Mail</li><li tabindex="-1" role="option" unselectable="on" class="k-item">Indicia Test FS</li><li tabindex="-1" role="option" unselectable="on" class="k-item k-state-selected k-state-focused" id="PartnerId_option_selected" aria-selected="true">Test Jesse</li></ul>

As you can see, no Id's are in the markup, which I find suspicious.

Here is how the ViewBag.Partners value is populated (in the controller):
/// <summary>
/// Populates the partners.
/// </summary>
protected void PopulatePartners()
{
    ViewBag.Partners = Database.Partners.Select(pg => new { pg.Id, pg.FriendlyName }).ToArray();
}

What is going on here? Why is the normal Html.DropDownListFor working, while Kendo's version isn't?
Indicia
Top achievements
Rank 1
 answered on 18 Dec 2014
13 answers
249 views
Hi I have a list of items in a multiselect and I want them to be received in the order that the user has specified when being sent to the controller

Right now they seem to be sorted by whatever the datasource is sorted by.

Any tips?
Alexander Popov
Telerik team
 answered on 18 Dec 2014
1 answer
777 views
Hi,

I've created a simple MVC 5 project with a Kendo grid to display a few records from a remote server. When i run the application, the kendo grid appears but displays no records. 
I checked Fiddler and found no errors or circular references. Furthermore, the JSON output shows the correct data in it but its simply not displaying in the grid. Here is the grid and controller code:

<div style="width:830px;font-size:x-small; padding-top:40px;">
 
        @(Html.Kendo().Grid<SystemsFormsMVC.Models.vMyForm>()
 
        .Name("Grid1")
 
        .Columns(columns=>
 
        {
 
            columns.Bound(o => o.Id);
 
            columns.Bound(o => o.SystemName);
 
            columns.Bound(o => o.FormType);
 
 
            })
              
 
            .DataSource(dataSource => dataSource
 
             .Ajax()
 
             .PageSize(5)
 
             .Read(read => read.Action("GetMyForms", "Home"))             
 
                )
 
                .Pageable()
 
                .Navigatable()
 
                .Sortable()
 
                .Filterable()
 
            )
</div>

Controller:
public ActionResult GetMyForms([DataSourceRequest] DataSourceRequest request)
{
    var query = _repository.GetMyForms(GetCurrentUserName());
    query = query.OrderBy(s => s.RequestDate);
    return Json(query, JsonRequestBehavior.AllowGet);
}
 
  
 
public IQueryable<vMyForm> GetMyForms(string UserName)
{
    SystemsFormsDataContext db = new SystemsFormsDataContext();
    IQueryable<vMyForm> query;
    Int32 UserId = GetCurrentUserId(UserName);
 
    try
    {
        query = (from s in db.vMyForms
                 where s.UserId == UserId
                 select s);   
    }
    catch (Exception ex)
    {
        query = (from s in db.vMyForms
                 where s.UserId == 0
                 select s);
    }
 
    return query;
}

Could you please help me figure out what the issue is with the data not displaying in the grid?

Thanks,  Shuja

Georgi Krustev
Telerik team
 answered on 18 Dec 2014
10 answers
166 views
I am reviewing the  new export to Excel feature in version 2014.3.1119.   This feature is really nice, but I cannot find a way to correctly export a grid with dropdownlists.   The export shows the column, but include the foreign key, not the dropdownlist text.   The new Export to PDF works correctly and downloads the text for the dropdownlist.    Is there a way to get the Export to Excel to work correctly on dropdownlists?

Thanks for your help.
Gayathri Rao
Top achievements
Rank 1
 answered on 18 Dec 2014
2 answers
119 views
I have a treeview with remote data binding. Every time I expand a node it does a GET with the parent Id as parameter. Is it possible change the GET for a POST?

The reason to do this is for security. We either need to encrypt the parameter on the GET or change it as a POST.
Ana Clara
Top achievements
Rank 1
 answered on 17 Dec 2014
1 answer
822 views
Hi,

We've just come to integrating our product which uses the Telerik.UI.for.AspNet.Mvc5 NuGet package and we get errors stating that it cannot be found. Having looked at Nuget.org, it seems that it has disappeared.

Any reason for this, or is there an alternative location that I can use? I notice a ZIP file in my Product download page. I guess I need to host that locally. THough I would like confirmation that the original NuGet repository package has disappeared - and why considering this will break a lot of builds.

Thanks

Nathan
Sebastian
Telerik team
 answered on 17 Dec 2014
1 answer
117 views
I would like to create sub total rows and group header rows for Monthly and Yearly totals and counts. I have a date field and a payment field. I can't see any way of doing this without creating extra columns in my data. Is there an example that works with dates that is available anywhere?


Thanks,


Larry
Petur Subev
Telerik team
 answered on 17 Dec 2014
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?