Telerik Forums
UI for ASP.NET Core Forum
2 answers
217 views

Hello,

How to use drag & drop to move a row over another in Kendo grid?

then I need the source row ID and the target row ID in the drop event where I will make an Ajax call to merge the rows into one at Service SQLServer table...

robert

Robert Madrian
Top achievements
Rank 1
Veteran
Iron
 answered on 14 Feb 2018
7 answers
727 views

Hi, I'm having a weird issue with dropdownlists and date pickers. Basically they work fine if I dont scroll may page at all but when I scroll it looks like the dropdown or datepickers child items are stuck at the original position relative to my page height. 

I attached a screenshot of what is happening.

Most of my controls are pretty basic. Is there something I'm missing in the controls thats messing with the placement of the child items?

Here is one of my drop down lists:

<div class="form-group">
    <label asp-for="timezone" class="user-label col-md-2"></label>
    <div class="col-md-4">
        @(Html.Kendo().DropDownList()
            .Name("timezone")
            .DataTextField("Text")
            .DataValueField("Value")
            .OptionLabel("Select Time Zone")
            .BindTo(new List<SelectListItem>() {
                new SelectListItem() { Text = "0 EST", Value = "0" },
                new SelectListItem() { Text = "-1 CEN", Value = "-1" },
                new SelectListItem() { Text = "-2 MTN", Value = "-2" },
                new SelectListItem() { Text = "-3 PAC", Value = "-3" },
                new SelectListItem() { Text = "-4 ALA", Value = "-4" },
                new SelectListItem() { Text = "-5 HAW", Value = "-5" },
                new SelectListItem() { Text = "+1 ATL", Value = "1" },
                new SelectListItem() { Text = "+1.5 NFI", Value = "1.5" }
            })
            .Value(Model.timezone.ToString())
        )
    </div>
</div>

 

Here is one of my date pickers:

<div class="form-group">
    <label asp-for="sign_on_expiry_date" class="user-label col-md-2"></label>
    <div class="col-md-4">
        @(Html.Kendo().DatePicker()
            .Name("sign_on_expiry_date")
            .Value(Model.sign_on_expiry_date)
        )
    </div>
</div>
neet-o
Top achievements
Rank 1
 answered on 14 Feb 2018
10 answers
177 views
ho

hi All,
I have a razor view "CDIS.cshtml" which is using a model object to render content. Now in this view, i have a submit button which calls an action method of the controller. In this action method, i need to use the same model object, which was used to render data in the previous view. My controller action method somehow gets the model object from the view, but it is empty. My target in the controller action is to use the same model object's values, which were used in the last view.
CDIS.cshtml

<p><br>@model MvcMovie.Controllers.Rootobject;
 
 
@{
    ViewData["Title"] = "CDIS subordinates";
}
<h2>@ViewData["Title"] for Group ID: <b>@Html.DisplayFor(model => model.data[0].groupId)</b></h2>
<h3>@ViewData["Message"]</h3>
 
 
<table class="table">
    <thead>
        <tr>
            <th>
                @Html.DisplayNameFor(model => model.data[0].id)
            </th>
 
 
 
            <th>
                @Html.DisplayNameFor(model => model.data[0].fullName)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.data[0].sourceSystem)
            </th>
            <th></th>
        </tr>
    </thead>
    <tbody>
        @foreach (var item in Model.data)
        {
 
            if (item.sourceSystem != "CRYSTAL_GLOBAL")
            {
                <tr>
                    <td>
                        @Html.DisplayFor(modelItem => item.id)
                    </td>
 
                    <td>
                        @Html.DisplayFor(modelItem => item.fullName)
                    </td>
                    <td>
                        @Html.DisplayFor(modelItem => item.sourceSystem)
                    </td>
                </tr>
            }
 
        }
 
        <tr>
 
            <td>
                <form asp-controller="CDISRecords" asp-action="CONIS" method="get">
                    <p>
                        <input type="hidden" name="GroupID" value="@Html.DisplayFor(model => model.data[0].groupId)">
 
                        <input type="hidden" name="dataModel" value=@Html.DisplayFor(model => model.data)>
                        <input type="hidden" name="dModel" asp-for="@Model.data" />
                        <div>
                            <input type="submit" value="GET Consent" class="btn btn-default" />
 
                            | For Date | :
                            <input type="date" name="consentDate">
                        </div>
                    </p>
                </form>
 
            </td>
        </tr>
    </tbody>
</table> <br></p><p></p>

CDISController.cs
    

 public async Task<IActionResult> CONIS(int? GroupID, MvcMovie.Controllers.Datum rootobject, MvcMovie.Controllers.Datum dModel)
        {
                Console.WriteLine($"City CONIS: " + dModel.city + "Group ID CONIS: " + rootobject.groupId + "Full Name CONIS : " + dModel.fullName);
             
 
            return View();
        }

 

 

In the above controller action, i have tried different ways to pass the model from the view, but each time, the values *-> City CONIS: " + dModel.city + "Group ID CONIS: " + rootobject.groupId + "Full Name CONIS : " + dModel.fullName *, are empty.

On the console, I see the following:

MvcMovie> Executing action method MvcMovie.Controllers.CDISRecordsController.CONIS (MvcMovie) with arguments (39256600, MvcMovie.Controllers.Datum, MvcMovie.Controllers.Datum) - ModelState is Valid
MvcMovie> City CONIS: Group ID CONIS: 39256600Full Name CONIS :

---

Perhaps my approach is incorrect, or I am passing the model reference incorrectly, because "City CONIS" is empty and Full Name CONIS is also empty. Somehow, Group ID CONIS is showing value. I have alos tried, for City and Name with "rootobject" like $"City CONIS: " + rootobject.city, but empty.
Any help shall highlly be appreciated. In nutshell, I need the values (appearing the table inside a view) to be passed to the controller to do further action. The values in the view are not fixed number of textfields rather values that i am showing in the table, hence i need the object to be passed further so that i can iterate on the object. 


Neli
Telerik team
 answered on 14 Feb 2018
2 answers
310 views

Is it possible to add the AutoComplete control to the ToolBar 

I was trying something like this but I don't think I'm on the right track.

Thanks,

Richard

@(Html.Kendo().ToolBar()
    .Name("ToolBar")
    .Items(items =>
    {
        items.Add().Type(CommandType.Button).Text("Button");
        items.Add().Type(CommandType.Button).Text("Toggle Button").Togglable(true);
 
        items.Add().Type(CommandType.Separator);
 
        items.Add().Template("<label for='dropdown'>Search:</label>");
        items.Add().Template(
            @(Html.Kendo().AutoComplete()
                .Name("GridSearch")
                .DataTextField("AppName")
                .Filter(FilterType.Contains)
                .MinLength(2)
                .DataSource("GridDataSource")
                ) ;
Richard
Top achievements
Rank 2
Iron
Iron
Veteran
 answered on 14 Feb 2018
1 answer
115 views

Hi,

 

I have a chart displaying the number of firm and speculative hours (area series). To do this, I retrieve my data from my controller and apply a grouping on the type (firm or speculative) and display stacked series using:

series.Area(model => model.Loe).Name("#= group.value #").CategoryField("YearMonth").Stack(true);

 

All work well but now, I want to add a new series displaying the work force(Data come from the same source) using:

series.Line(model => model.Capacity).Name("Capacity").CategoryField("YearMonth").Aggregate(ChartSeriesAggregate.Sum);

 

but the new series are added for each group. What I want is the new series appears only 1 times not for each group.

How I can do this?

 

Sylvain

Tsvetina
Telerik team
 answered on 13 Feb 2018
5 answers
468 views

.NET Core 2.0 MVC Application; Telerik UI for AspNet Core & Kendo UI 2017.3.1116

I am following the example posted at http://demos.telerik.com/aspnet-core/editor/imagebrowser

The control is able to read, create a folder, and delete but I cannot upload an image or file.  The error returned in the alert is, "Error! The requested URL returned 500 - ".  This is in debug mode in Visual Studio 2017.  I checked IIS Express log files and system events which give no additional information.

The system response title is, "<h1>An unhandled exception occurred while processing the request.</h1>
            <div class="titleerror">MissingMethodException: Method not found: &#x27;Microsoft.Net.Http.Headers.ContentDispositionHeaderValue Microsoft.Net.Http.Headers.ContentDispositionHeaderValue.Parse(System.String)&#x27;.</div>
                <p class="location">Kendo.Mvc.UI.FileBrowserController.GetFileName(IFormFile file)</p>"

This leads me to believe this is an issue in Core 2.0 compatibility with the way the IFormFile interface is implemented internally in the Kendo.Mvc.UI.EditorImageBrowserController class.

 

 

 

Dimitar
Telerik team
 answered on 12 Feb 2018
1 answer
121 views

I've attempted to install Telerik DevCraftUltimateSetup_b_2017_4_1204_0 a couple of times.  The second time I left it on over night and it seems to hang on my Windows 7 machine (with VS 2017).  Is there any work around to this.  I even went so far as to install only one component (ASP>NET CORE) and it seems to have hung up even on this install.

 

Any help would be appreciated.

Michael
Top achievements
Rank 1
 answered on 11 Feb 2018
6 answers
1.2K+ views

So I have an issue where if there are two grids on the same page using different names and both having a column that uses the ".Select()" method for checkboxes, the "select all" checkbox in the header of one of the grids works correctly, but the second one will only select the first one's rows and not it's own.

Here is some sample code:

<div class="row">
        <div class="col-xs-12 col-md-6">
            <h2 class="text-center">Users in rule</h2>
            @(Html.Kendo().Grid<UserViewModel>()
                .Name("UsersInRule")
                .Columns(columns =>
                {
                    columns.Select().Width(50);
                    columns.Bound(c => c.Name).Width(300);
                    columns.Bound(c => c.Username).Width(200);
                })
                .Sortable()
                .Resizable(resize => resize.Columns(true))
                .ToolBar(toolbar => toolbar.Create())
                .DataSource(dataSource => dataSource
                    .Ajax()
                    .Read(read => read.Action("ListUsersInRule", "User", new { Area = "Admin", id = Model.Id }))
            )
            )
        </div>
        <div class="col-xs-12 col-md-6">
            <h2 class="text-center">Available users</h2>
           @(Html.Kendo().Grid<UserViewModel>()
                .Name("AvailableUsers")
                .Columns(columns =>
                {
                    columns.Select().Width(50);
                    columns.Bound(c => c.Name).Width(300);
                    columns.Bound(c => c.Username).Width(200);
                })
                .Sortable()
                .Resizable(resize => resize.Columns(true))
                .ToolBar(toolbar => toolbar.Create())
                .DataSource(dataSource => dataSource
                    .Ajax()
                    .Read(read => read.Action("ListUsersNotInRule", "User", new { Area = "Admin", id = Model.Id }))
            )
        )
        </div>
    </div>

 

 

What happens is when I click on the header checkbox for the "AvailableUsers" grid, it will select the rows in the "UsersInRule" grid. The header checkbox in the "UsersInRule" grid works just fine in selecting rows in its own grid. How do I configure it so that the header checkboxes will only select the rows in their own grid?

Currently using Kendo UI v2017.3.1026 (kendo.all.min.js and kendo.aspnetmvc.min.js) that I grabbed from the telerik.ui.for.aspnet.core commercial zip.

Stefan
Telerik team
 answered on 09 Feb 2018
1 answer
955 views

Hi,

I have defined my Spreadsheet as follows:

@(Html.Kendo().Spreadsheet()
    .Name("spreadsheet")
    .Sheets(sheets =>
    {
        sheets.Add()
            .Name("mySheet")
            .Columns(c =>
            {
                c.Add().Width(150);
                c.Add().Width(150);
            })
            .DataSource<MyViewModel>(ds => ds
                .Ajax()
                .Batch(true)
                .Read("ReadTimeSeries", "MyController")
                .Model(m => {
                    m.Field(p => p.Timestamp);
                    m.Field(p => p.Value);
                })
            );
    })
    .Sheetsbar(false)
)

When the Spreadsheet loads the data, it is displayed as Date only - the time part seems to be missing.

This is my DataModel:

    public class MyViewModel
    {
        [Display(Name = "Zeitstempel")]
        [DisplayFormat(DataFormatString = "{0:dd.MM.yyyy HH:mm}"]
        public DateTime Timestamp { get; set; }

        [Display(Name = "Wert")]
        [DisplayFormat(DataFormatString = "{0:#,###.###}")]
        public decimal Value { get; set; }
    }

The DisplayFormatAttribute seems to be ignored. The Problem is that the count of the rows vary, so I can't predefine the format using Rows.Add().Cells(c => c.Add().Format("dd.MM.yyyy HH:mm").

 

How can I achieve the Timestamps to be displayed with date AND time?

Veselin Tsvetanov
Telerik team
 answered on 09 Feb 2018
1 answer
422 views
Hi, I'm trying to use the Kendo Notification widget to add error/success messages to my page. Currently I'm using modelstate errors to display a quick message but I want to switch over to the kendo widget. My issue is I want to be able to set the notification message from the server side in the controller. Is there any way to easily access the notification widget from my controller?
Plamen
Telerik team
 answered on 08 Feb 2018
Narrow your results
Selected tags
Tags
+? more
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?