Telerik Forums
UI for ASP.NET MVC Forum
2 answers
2.0K+ views

I'm looking to open a popup from a button on a grid row.

The purpose is not really to edit the row data but rather to take the row id (in this case company id) and load a modal with some dropdowns (for selecting/assigning users) and assign those to the company id passed into the modal view.

Is this kind of thing possible? If so, how might I go about starting to implement it?

Can I do it by opening a popup that contains a partialview?

Thanks.

Terry
Top achievements
Rank 1
 answered on 16 Jun 2017
1 answer
89 views

Hi,

When I browse to a certain page in my project with a Kendo Grid inside, I'm having a little issue. The grid is shown not visually styled momentarily when the page is loaded. It's just a little "flash" of it, and then it's rendered appropriately. Any idea how to fix this?

Stefan
Telerik team
 answered on 16 Jun 2017
1 answer
74 views

I have an ASP.NET MVC application and it has a page that makes use of the KendoGrid:

$(function () {
        $("#Grid").kendoGrid({
            columns: [
                        { "title": "Straat", "field": "Straat" },
                        { "title": "Huisnummer", "field": "Huisnummer" },
                        { "title": "Volledige Naam", "field": "VolledigeNaamKoperHuurder" },
                        { "title": "Plaats", "field": "Plaats" },
                        { "title": "Objectsoort", "field": "Objectsoort" },
                        { "title": "Objectcode", "field": "Objectcode" }],
            dataSource: {
                transport: {
                    read: "/bouwobject/getbouwobjectenjson",
                    dataType: "json"
                },
                pageSize: 15
            },
            selectable: "row",
            scrollable: false,
            pageable: {
                messages: {
                    display: "{0} - {1} van {2} items",
                    empty: "Geen items te tonen",
                    page: "Pagina",
                    of: "van {0}",
                    itemsPerPage: "items per pagina",
                    first: "Ga naar de eerste pagina",
                    previous: "Ga naar de laatste pagina",
                    next: "Ga naar de volgende pagina",
                    last: "Ga naar de laatste pagina",
                    refresh: "Verversen"
                }
            },
            sortable: { mode: "single" },
            filterable: {
                messages: {
                    info: "Toon items met waarde",          // sets the text on top of the filter menu
                    filter: "Filter",                       // sets the text for the "Filter" button
                    clear: "Opheffen",                      // sets the text for the "Clear" button

                    // when filtering boolean numbers
                    isTrue: "is waar",                      // sets the text for "isTrue" radio button
                    isFalse: "is onwaar",                   // sets the text for "isFalse" radio button

                    // changes the text of the "And" and "Or" of the filter menu
                    and: "En",
                    or: "Of"
                },
                operators: {
                    // filter menu for "string" type columns
                    string: {
                        eq: "Is gelijk aan",
                        neq: "Is ongelijk aan",
                        startswith: "Start met",
                        contains: "Bevat",
                        ncontains: "Bevat niet",
                        endswith: "Eindigt met"
                    },
                    // filter menu for "number" type columns
                    number: {
                        eq: "Is gelijk aan",
                        neq: "Is ongelijk aan",
                        gte: "Is groter dan of gelijk aan",
                        gt: "Is groter dan",
                        lte: "Is kleiner of gelijk aan",
                        lt: "Is kleiner dan"
                    },
                    // filter menu for "date" type columns
                    date: {
                        eq: "Is gelijk aan",
                        neq: "Is ongelijk aan",
                        gte: "Is na of op",
                        gt: "Is na",
                        lte: "Is op of voor",
                        lt: "Is voor"
                    },
                    // filter menu for foreign key values
                    enums: {
                        eq: "Is gelijk aan",
                        neq: "Is ongelijk aan"
                    }
                }
            },
            groupable: {
                messages: {
                    empty: " Verplaats de titel van een kolom hier naar toe om te groeperen op die kolom"
                }
            }
        });
    });

This grid is on a page where there is a button where the user can navigate to a new page. This page has a form, and once filled in and submitted stays on that page. The user then can click a button to go back to the page with the grid. Now, on my machine this grid is updated with some of the values the user just filled in the form. When deployed at the client, this does not happen. The use has to refresh the page with the grid for the values to come up.

What is happening?

Stefan
Telerik team
 answered on 16 Jun 2017
3 answers
472 views

I need to make a Custom Toolbar button mesh in with the other 2 buttons. 

(See attachment and code)

.ToolBar(tools =>
{
 tools.Custom().Text("Print this Page").Name("PrintPage").Url("#").HtmlAttributes(new { @class = "export-img" });
                   tools.Pdf().Text("Export all records to PDF");
                   tools.Excel().Text("Export all records to Excel");
}
 )

 

I have tried to apply CSS just can't get the ".Custom()" to take effect.

Suggestions?

Thanks

 

 

 

Georgi
Telerik team
 answered on 15 Jun 2017
13 answers
2.8K+ views
Having trouble implementing MultiSelectFor and binding to remote data.

                                @(Html.Kendo().MultiSelectFor(model => model.Solutions)
                                    .DataSource(dataSource => dataSource
                                        .Read(read => {read.Action("GetSolutionNames", "Editor");
                                            read.Type(HttpVerbs.Post);})
                                        .ServerFiltering(false)
                                    )
                                    .AutoBind(false)
                                    .Placeholder("Select solutions...")                        
                                )

model.Solutions is a List<string>
The GetSolutionNames() Method in the controller simply returns a List<string>

Nothing is being passed back to the controller on submit.
Are there any examples of MultiSelectFor?

Documentation isn't great.
Dhruv
Top achievements
Rank 1
 answered on 14 Jun 2017
1 answer
124 views

Hi,

I've create a task sheduler. Read and create are working fine ( data are created in database with a generated Guid: oid) but when I try to update my task I've got an Internal error 500 visible on my Chrome developper console. In effect No data are sent !

Did I forgot something?

Please see my code:

@(Html.Kendo().Scheduler<Elearning.ViewModels.TasksViewModel>()
.Name("scheduler")
.Date(DateTime.Today)
.StartTime(new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, 6, 0, 0))
.DateHeaderTemplate("<span class='k-link k-nav-day'>#=kendo.toString(date, 'ddd dd/M')#</span>")
.Height(480)
.Views(views =>
{
    views.DayView();
    views.WorkWeekView(workWeekView => workWeekView.Selected(true));
    views.WeekView();
    views.MonthView();
    //views.AgendaView();
    //views.TimelineView();
})
        .Resources(resource =>
        {
            resource.Add(m => m.CoursID)
                .Title("Leçon")
                .DataTextField("Text")
                .DataValueField("Value")
                .DataColorField("Group.Name")
                .BindTo(Model.Lessons);
        })
                .DataSource(d => d
                    .Model(m => {
                        m.Id(f => f.oid);
                        m.Field(f => f.oid).DefaultValue(new Guid());
                        m.Field(f => f.Title);
                        m.Field(f => f.Start);
                        m.Field(f => f.End);
                        m.Field(f => f.StartTimezone);
                        m.Field(f => f.EndTimezone);
                        m.Field(f => f.IsAllDay);
                        m.Field(f => f.Description);
                        m.Field(f => f.RecurrenceRule);
                        m.Field(f => f.RecurrenceException);
                        m.Field(f => f.RecurrenceID);
                        m.Field(f => f.UtilisateurID).DefaultValue(UserContext.CurrentUser.oid);
                        m.Field(f => f.CoursID);
                    })
                  .Read("Read", "Tasks")
                  .Create("Create", "Tasks")
                  .Update("Update", "Tasks")
                  .Destroy("Destroy", "Tasks")
                  )
   
            )
Plamen
Telerik team
 answered on 14 Jun 2017
30 answers
4.3K+ views
Hello,
Can i customize the default buttons for CRUD operations(add,delete,edit) ?for example remove or change text,add only a custom image,add a tooltip.something just like   the Grid RadControl where i can customize all that.

Regards,
Daniel
Dimo
Telerik team
 answered on 14 Jun 2017
3 answers
86 views

I have an MVC app, with a Grid in it.  It pulls it's data via ajax from an MVC Controller that reaches out to a restful API to retrieve it's data.  All along the "All" option has worked fine, but the number of records has been steadily increasing.  Now it's a little over 5000 records, and the "All" option no longer shows all of them.

In the Controller, after pulling the data from the restful API, the data is indeed all there before returning it to the grid via a DataSourceRequest.  In the browser console I see an error stating it's a 500 server error.

Is there a limit on how many records the grid can deal with?  5000 surely seems like a small number...  

Here is my controller code, which is feeding the grid:

[HttpPost]
       [ActionName("DocumentSearchResults")]
       public ActionResult DocumentSearchResults([DataSourceRequest] DataSourceRequest request, bool unMatchedOnly, string docketNumber, string employeeId, string ssnNumber, string lastName, string firstName, string caseID, string garnishType, string clientId, string miscNotes, string startDate, string endDate)
       {
           GarnishmentDocumentSearch docSearch = new GarnishmentDocumentSearch()
           {
               UnMatchedOnly = unMatchedOnly,
               DocketNumber = docketNumber,
               EmployeeId = employeeId,
               SSNNumber = ssnNumber,
               LastName = lastName,
               FirstName = firstName,
               CaseId = caseID,
               GarnishType = garnishType,
               ClientId = clientId,
               StartDate = !string.IsNullOrEmpty(startDate) ? DateTime.Parse(startDate) : DateTime.MinValue,
               EndDate = !string.IsNullOrEmpty(endDate) ? DateTime.Parse(endDate) : DateTime.MinValue,
               MiscNotes = miscNotes
           };
 
           List<UploadedDocument> response = WebApiHelper.CallPostAPI<List<UploadedDocument>, GarnishmentDocumentSearch>($"{_garnishAPI}DocumentSearch", docSearch);
           return Json(response.ToDataSourceResult(request), JsonRequestBehavior.AllowGet);
       }

 

As I said, the response object contains all the records no problem, and again I reiterate, it worked fine until the record count hit 5000.  Several days ago, when it was still about 2900 records, the "All" option worked as expected.

 

Martin
Telerik team
 answered on 13 Jun 2017
1 answer
1.6K+ views
I'm new & I'm hoping there's some sample code to help jumpstart my work.  I need to upload a CSV & place it in a KendoGrid using MVC. If possible, from the Select button, and not show the input Text box, and not show the Remove option, since it should place the file contents straight into the grid & then delete the file.  I didn't see anything in the Code Library showing how to upload a CSV & place it in a grid, but it seems like someone must have done this before me.  Any guidance is appreciated.
Stefan
Telerik team
 answered on 13 Jun 2017
4 answers
1.2K+ views

I need a way to run javascript code after a sort or a filter has been done. Unusually, the datasource is in the view model - not an ajax call to the server.

 

Here is my grid:

 

    @(Html.Kendo().Grid(Model.TrunkGridData)
        .Name("TrunkSummaryGrid")
        .Columns(columns =>
        {
            columns.Bound(c => c.DepotNumber).Title("Depot").Sortable(true);
            columns.Bound(c => c.TrunkName).Title("Trunk").Sortable(true);
            columns.Bound(c => c.TipType).Title("Tip / Load").Sortable(true);
            columns.Bound(c => c.ArrivalTimeExpected).Title("Booked Arrival").Sortable(true);
            columns.Bound(c => c.ArrivalTimeActual).Title("Actual Arrival").Sortable(true);
            columns.Bound(c => c.DepartureTimeExpected).Title("Booked Departure").Sortable(true);
            columns.Bound(c => c.DepartureTimeActual).Title("Actual Departure").Sortable(true);
        })
        .Filterable()
        .Sortable()
        .Scrollable()
        .Selectable()
        .HtmlAttributes(new { style = "height:700px;" })
        .ToolBar(tools => tools.Excel())
        .Excel(excel => excel
            .FileName("TrunkSummary.xlsx")
            .Filterable(true)
            .ProxyURL(Url.Action("Excel_Export_Save", "Grid"))
        )
        .DataSource(dataSource => dataSource
            .Custom()
            .ServerFiltering(false)
            .ServerSorting(false)
            .Schema(schema => schema
                .Model(model =>
                {
                    model.Id("TrunkRouteID");
                    model.Field("DepotNumber", typeof(string));
                    model.Field("TrunkName", typeof(string));
                    model.Field("TipType", typeof(string));
                    model.Field("ArrivalTimeExpected", typeof(string));
                    model.Field("ArrivalTimeActual", typeof(string));
                    model.Field("DepartureTimeExpected", typeof(string));
                    model.Field("DepartureTimeActual", typeof(string));
                    model.Field("IsLate", typeof(bool));
                    model.Field("IsThirtyMinutesLate", typeof(bool));
                    model.Field("ArrivalMinsLate", typeof(double));
                    model.Field("DepartureMinsLate", typeof(double));
                    model.Field("TrunkRouteID", typeof(int));
                })
            )
        )
    )

Graham
Top achievements
Rank 2
Iron
Iron
 answered on 12 Jun 2017
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?