Telerik Forums
UI for ASP.NET MVC Forum
1 answer
1.5K+ views

Hi,

I want to add a specific class to the inputs in Inline editing .

How can I do it?

thanks

Viktor Tachev
Telerik team
 answered on 02 Feb 2018
3 answers
876 views

Hi,

at the moment I am converting the old Telerik MVC tool to Kendo MVC for one of our portals.

now I have an issue with a dynamic table, not always all fields are the same and I can't get it to work correctly.

my grid looks like this

@(Html.Kendo().Grid(Model.DefaultView)
                            .Name("Grid")
                            .DataSource(dataSource => dataSource
                                        .Ajax()
                                        .Read(read => read.Action("LoadData", "AutorisatieMatrix"))
                                        .Update(read => read.Action("_SaveBatchEditing", "AutorisatieMatrix"))
                                        .Model(model => model.Id("ProgramFunction"))
                                    )
                            .Sortable()
                            .Editable(editing => editing.Mode(GridEditMode.InCell))
                                .ToolBar(commands =>
                                {
                                    commands.Save();
                                })
                            .Columns(columns =>
                            {
                                columns.Bound("Id").Visible(false);
                                foreach (System.Data.DataColumn dcol in Model.Columns)
                                {
                                    if (dcol.ColumnName != "Id")
                                    {
                                        if (dcol.ColumnName == "ProgramFunction")
                                            columns.Bound("ProgramFunction")
                                                .EditorTemplateName("_ReadOnlyValue")
                                                .ClientTemplate("#=ProgramFunction#")
                                                .Title("Programmafunctie");
                                        else
                                        {
                                            columns.Bound(dcol.ColumnName)
                                                .EditorTemplateName("_PermissionEditor")
                                                .ClientTemplate(boo(this, "#=" + dcol.ColumnName + "#").ToHtmlString())
                                                .Title(dcol.Caption)
                                                ;
                                        }
                                    }
                                }
                            })

 

where I go through all colums specified in the model.
and the header gets created as it should.

In the controller in the Index I create an empby DataTable so the Model knows which colums to use.

public ActionResult Index()
        {
            var tbl = CreateNewDataTable();
            var model = tbl;
            return View(tbl);
        }

which seems to work fine.

Then In the loadData DataRequest I generate this same DataTable fill it, add a dynamic wrapper to include "Data" in the json
Convert is to Json and return the Content.

 

 

 

sjarl
Top achievements
Rank 1
 answered on 02 Feb 2018
9 answers
252 views
Is it possible to alter the behaviour of the spreadsheet with some javascript that would allow a user to type a value into a cell and then press the down arrow to set the value and move to the next cell? Simply registering the event and changing which cell is selected doesn't work because the value in the cell doesn't actually get set and I've tried simulating an enter key press but that didn't work because of compatibility issues.
Dimitar
Telerik team
 answered on 02 Feb 2018
1 answer
1.3K+ views

Hello,

I would like to use the ASP.NET MVC Kendo UI Grid to render a list of records that have a "Detail" button for each record (similar to this look: https://demos.telerik.com/aspnet-mvc/grid/custom-command).

I am currently using an AJAX-bound grid. I need to pass two values to the "Details" controller. Here is what I have so far:

.Columns( c=>
{
  c.Bound(c => personId);
  c.Bound(c => positionId);

 

  // Want to use a "Details" button to pass personId and positionId to HomeController/Details/{personId}/{positionId}

  c.Command( c => cmd.Custom("Details"))

})
.DataSource(d => d
  .Ajax()
  .Read(r => r.Action("GetPersons", "Home"))
)

 

However, the business logic in our application requires two values passed to the "Details" controller (see below).

1.
[HttpGet]
      public ActionResult Details(int personId, int positionId)
2.{
3.  Person person = Person.GetPerson(personId, positionId, myConnection);
4.  return View(person);
5.}
Viktor Tachev
Telerik team
 answered on 01 Feb 2018
1 answer
310 views

HI

I met a problem about Grid Sortable : 

  Grid setOptions sortable = false clear header template UNEXPECTEDLY.

What's going on ?? Why header template lost ? 
How to avoid this situation or 
how to disable sortable temporary and header template will not be cleared.

Sample Code : 


  View
                columns.Bound(c => c.Column1)
                  .HeaderTemplate
                  (
                    @<text>
                
                    <input type='number' class='k-textbox' onfocus="class1.focusAllDays({ element: this })" style='width: 50px; font-size: small;' />

                    </text>
                  )
                  .Width(280);


  Javascript

    class1 : 

    focusAllDays: function(e)
    {
      var grid = get your grid;
      //
      grid.setOptions({  sortable: false });
    },


Best regards

Chris



 

 

 

Stefan
Telerik team
 answered on 01 Feb 2018
1 answer
84 views
I have reproduced the issue on the demo you have provided in following link:
https://demos.telerik.com/kendo-ui/scheduler/index

1. goto https://demos.telerik.com/kendo-ui/scheduler/index
2. there is a resource "Call Charlie about the project"
3. set its start date as 6/11/2013 1:30 AM and set its end date as 6/12/2013 4:00 PM
4. Then this Resource will not be displayed on the scheduler. So in such cases how we can show resource for the multiple days without using "alldayevent" tab/option.
how can i view such resources which have part of view in business hours?
Neli
Telerik team
 answered on 01 Feb 2018
7 answers
187 views

With the recent release of 2018, I began the rework of several projects to also update them to the latest suite.  I can report that this with this release I was actually able to perform a MVC Upgrade wizard without failures.  That is a first for me.

My update strategy was as follows:  First I ran the Report upgrade process.  After it completes it reloaded the project and the Telerik product realized I still  had a un-upgraded MVC project to upgrade.  (That was a welcome change)  Upon clicking the upgrade wizard it actually went off and upgraded things.

Upon completion of the process I was able to perform a clean/rebuild solution with zero errors.  Using my normal testing process quickly confirmed everything met expectations.  That was a very welcome change.

My only complaint is that the upgrade process, of the MVC, is very invisible to the developer.  By this I mean the user has no visual indication that anything is happening except for the occasional busy cursor.  The status bar occasionally has a message but it seems to be very sporadic.   If you somehow improved this portion of your upgrade process things would be "perfect" in my mind.

NOTE: I did discover that you could monitor the contents of the recycle bin to see the progress of the upgrade process.  The upgrade process delete files, which end up in the recycle bin, so as long as the number of files is growing you know something is working.

 

Special Note:  Like most developers I also have one of those projects which are "from hell".  It is a hybrid project that combines ASPX, MVC, and the HTML5 reporting tools.  Collectively this project has never been upgrade capable via the wizards.  They literally crashed each time I tried them.  Given the hybrid nature, I always accepted is as something I caused myself by building the "beast".  I can report that with this release (2018-1) the upgrade process actually worked.  I ran the report upgrade wizard first.  I then ran the MVC Upgrade process.  I then ran the ASPX upgrade wizard.  All three worked without error.  None crashed. (A very welcome change)  The end result compiled with errors as the ASPX process removed the MVC references as unnecessary.  Upon re-adding that reference to the solution, everything compiled and tested with 100% accuracy.  All tests ran without error.  I was thrilled that this un-supported process actually worked!

Nikolay Mishev
Telerik team
 answered on 01 Feb 2018
5 answers
327 views

Hello there,

I have a Kendo Grid with a lot of numerical data in it and I'd like to incorporate the Kendo range Slider into it so that users can adjust the sliders and this will filter the grid.  Having read the documentation I'm not 100% sure how to do this. Can anyone help?

 

@(Html.Kendo().Grid(Model)
    .Name("MyGrid")
    .Columns(columns =>
        {
            columns.Bound(p => p.vessel_name).Title("Vessel");
            columns.Bound(p => p.vessel_bhp).Title("Type");
            columns.Bound(p => p.fixture_charterer).Title("Charterer");
            columns.Bound(p => p.current_location).Title("Location");
            columns.Bound(p => p.next_charterer_info).Title("Next Charter").Width(200);
            columns.Bound(p => p.fixture_work).Title("Work");
            columns.Bound(p => p.fixture_note).Title("Notes");
            columns.Bound(p => p.vessel_status).Title("Status");        
        }
    )
    .Pageable()
    .Scrollable()
    .Sortable()
    .Events(e => e.DataBound("OnDataBound"))
    .DataSource(dataSource => dataSource
        .Ajax()
        .Model(model =>
        {
            model.Id(p => p.vessel_idx);
            model.Field(p => p.vessel_idx).Editable(false);
        })
        .PageSize(50)
        .Sort(sort => sort.Add("vessel_status").Ascending())
        .ServerOperation(false)
        .Events(events => events.Error("error_handler"))
        .Create(update => update.Action("EditingInline_Create", "Grid"))
        .Read(read => read.Action("EditingInline_Read", "Grid"))
                .Update(update => update.Action("tbl_vessels", "Grid"))
        .Destroy(update => update.Action("EditingInline_Destroy", "Grid"))
        ))

For example I'd like the ranger slider to filter the grid when people choose a range for vessel_bhp.

Any help is appreciated.
​

Stefan
Telerik team
 answered on 01 Feb 2018
2 answers
147 views

Hello,

 

First off, this is the best place I found to post this in, it's not MVC specific, I know.

 

There seems to be a slight bug in the Gantt chart when using Internet Explorer (I tried Firefox and Chrome, they didn't exhibit this behaviour). Atleast the MVC and jQuery UI versions seem to be affected. You can reproduce this by browsing to https://demos.telerik.com/aspnet-mvc/gantt or https://demos.telerik.com/kendo-ui/gantt/index with IE11 and then scrolling the Gantt chart to the bottom. If you click on any task in the right above "Integration testing", the left side of the Gantt (with ID, Title, Start Time, End Time) will properly scroll to the selected task. But if you click on "Integration testing" or a task below it, the left side will jump to the top, showing "ID 7 Software validation" and you have to nudge your scroll wheel for the left side to focus on the task you clicked on.

 

This happens on fully updated Windows 7 and IE11 with the version info in the attached picture.

Rami
Top achievements
Rank 1
Veteran
 answered on 01 Feb 2018
3 answers
1.5K+ views

Hi,

I am using Telerik ASP.NET MVC Extensions 2016.1.111.0. and Razor. The CheckBoxFor control behaves slightly illogical - in one case it shows a label, in another case it does not. See the attached screenshot.

Both parameters are booleans, the difference is that one of the has a DisplayName:

 

From the model.cs

        public bool Dator { get; set; }
        [DisplayName("Passerkort 07:30-17:00")]
        public bool Passerkort { get; set; }

 

From the Index.cshtml

            @Html.LabelFor(m => m.Dator)
            @Html.Kendo().CheckBoxFor(m => m.Dator)
            @Html.LabelFor(m => m.Passerkort)
            @Html.Kendo().CheckBoxFor(m => m.Passerkort)

The parameter with the DisplayName specified will be displayed with a label attached to the CheckBoxFor, so to get rid of it I have to set .Label("") for that checkbox. Not a big deal, but I think maybe this was not the intention.

Best regards,

Henrik

 

Joana
Telerik team
 answered on 31 Jan 2018
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
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
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?