Telerik Forums
UI for ASP.NET MVC Forum
1 answer
370 views

I am following the directions for batch editing mode here:
https://demos.telerik.com/aspnet-mvc/grid/editing

When I disable server operation, I assume I am getting a LOT of records back from the database (50K+) and this is causing the following error: Error during serialization or deserialization using the JSON JavaScriptSerializer. The length of the string exceeds the value set on the maxJsonLength property.

How can I use ServerOperation for Paging/Sorting/Filtering functionality, but still use Batch with InCell editing mode?

Controller Code:

public ActionResult Contacts_Read([DataSourceRequest]DataSourceRequest request)
       {
     
           var dbcontext = new CRMDataModel2();
           IQueryable<vw_CRM_GetCompanyContacts> contacts = dbcontext.vw_CRM_GetCompanyContacts;
 
       
           DataSourceResult result = contacts.ToDataSourceResult(request, contact => new {
               Comp_Secterr = contact.Comp_SecTerr,
               PersonLinkId = contact.PersonLinkId,
               Office = contact.Office,
               Company = contact.Company,
               Year = contact.Year,
               Branch = contact.Branch,
               Supervisor = contact.Supervisor,
               AccountManager = contact.AccountManager,
               Contact = contact.Contact,
               Role = contact.Role,
               NPS = (bool)contact.NPS,
               Statement = (bool)contact.Statement,
               Invoices = (bool)contact.Invoices,
               FieldReport = (bool)contact.FieldReport,
               RainContact = (bool)contact.RainContact,
           });
 
           return Json(result);
       }
 
View Code:
//grid is set to incell editing
 .Edtable(editable => editable.Mode(GridEditMode.InCell))
 
 //data source is set to server operation false, batch true
DataSource(dataSource =>
            dataSource.Ajax()
            .ServerOperation(false)
            .Batch(true)
            .Read(read => read.Action("Contacts_Read", "ContactMaintenance"))
            .Update(update => update.Action("Contacts_Update", "ContactMaintenance"))
            .Destroy(destroy => destroy.Action("Contacts_Destroy", "ContactMaintenance"))
//...omitted for brevity
Georgi
Telerik team
 answered on 18 Dec 2018
2 answers
865 views

i notice that my multi-select filter on my grid does not have a Select all checkbox as I have seen in the multi-filter checkbox demo -

I am using the asp.mvc version visual studio version 15.8.1 - 

To see this, create new telerik mvc core project using the grid template

which has this grid

<div class="row">
<div class="col-xs-18 col-md-12">
@(Html.Kendo().Grid<TelerikAspNetCoreApp1.Models.OrderViewModel>()
.Name("grid")
.Columns(columns =>
{
columns.Bound(p => p.OrderID).Filterable(false);
columns.Bound(p => p.Freight);
columns.Bound(p => p.OrderDate).Format("{0:MM/dd/yyyy}");
columns.Bound(p => p.ShipName);
columns.Bound(p => p.ShipCity);
})
.Pageable()
.Sortable()
.Scrollable()
.Filterable()
.HtmlAttributes(new { style = "height:550px;" })
.DataSource(dataSource => dataSource
.Ajax()
.PageSize(20)
.Read(read => read.Action("Orders_Read", "Grid"))
)
)
</div>
</div>

 

add this to the freight column

Filterable(ftb => ftb.Multi(true))

the resulting filter has no select all checkbox as shown in this demo

https://demos.telerik.com/aspnet-mvc/grid/filter-multi-checkboxes

 

can you look into this and see what is going on

 

thanks

 

Jim

 

 

 

James
Top achievements
Rank 1
 answered on 17 Dec 2018
3 answers
456 views

Hi,

I've spent my whole day searching for a way of reloading a scheduler's resources and data from a javascript function. So far I've reduced my code to:

var scheduler = $("#MyScheduler").data("kendoScheduler");
  
scheduler.resources[0].dataSource.read();
scheduler.dataSource.read();

 

My code calls the correct methods against the controller and the new data is returned. However, the new resources are not displayed correctly. A very similar problem found here: https://www.telerik.com/forums/modifying-resources-datasource-dynamically.

As stated in the above post, "modifying the scheduler resources after it's initialization is not supported". It's also recommended that the scheduler should be destroyed and re-initialize. Nencho also provides a link to http://dojo.telerik.com/egoq which shows a jQuery method of doing so. 

can someone provide me with an MVC example of doing so?

I've got a horrible feeling that I need to call the action methods in the controller manually. There must be a better way...

Here's my RazorView set up of my .

@(Html.Kendo().Scheduler<AlternativeViewModel>()
    .Name("AlternativeScheduler")
    .Date(Model.TargetDate.GetValueOrDefault(DateTime.Today).Date)
    .StartTime(new DateTime(2015, 03, 31, 00, 00, 00))
    .EndTime(new DateTime(2015, 03, 31, 23, 59, 59))
    .Selectable(true)
    .MajorTick(1440)
    .MinorTickCount(1)
    .AllDaySlot(true)
    .CurrentTimeMarker(false)
    .Height(720)
    .EventTemplate(
        "<div style=text-align:center> " +
            "<p style='margin-top: 4px'>#= title #</p>" +
            "<p>" +
                "#= kendo.toString(ShiftStart, 'HH:mm') # - #= kendo.toString(ShiftEnd,'HH:mm') #" +
            "</p>" +
        "</div>")
    .Editable(editable =>
    {
        editable.TemplateId("SchedulerEditorAlt");
        editable.Destroy(false);
    })
    .Views(views =>
    {
        views.TimelineWeekView(timeline => timeline.EventHeight(80).Title("Week").Selected(true))
            .Footer(false)
            .ShowWorkHours(false)
            .DateHeaderTemplate("#=kendo.toString(date, 'ddd dd MMM')# ");
    })
    .Timezone(Model.TimeZone)
    .CurrentTimeMarker(c => c.UseLocalTimezone(false))
    .Group(group => group.Resources("ServiceName").Orientation(SchedulerGroupOrientation.Vertical))
    .Events(e =>
    {
        e.ResizeEnd("Roster.onResizeEndAlt");
        e.Edit("Roster.onEditEventAlt");
        e.Save("Roster.onSaveAlt");
        e.Cancel("Burger.onClose");
        e.DataBound("Burger.onAltDataBound");
        e.MoveEnd("Burger.onMoveEndAlt");
        e.Navigate("Burger.onAltNavigate");
        e.Change("Burger.onSchedulerChangeAlt");
    })
    .Resources(resource => resource
        .Add(m => m.ShiftPatternId)
        .Title("ServiceName")
        .Name("ServiceName")
        .Multiple(true)
        .DataTextField("ServiceName")
        .DataValueField("ShiftPatternId")
        .DataColorField("Color")
        .DataSource(source => source
            .Read(read => read
                .Action("GetServiceNames", "Scheduler").Type(HttpVerbs.Post)
                .Data("Burger.getSchedulerDataWithFormat")
            )
        )
    )
    .Resources(resource => resource
        .Add(m => m.Status)
        .Title("ShiftStatusId")
        .Name("Status")
        .DataTextField("WorkerName")
        .DataValueField("BurgerStatusId")
        .DataColorField("Color")
        .DataSource(source => source
            .Read(read => read
                .Action("GetShiftStatusResources", "Scheduler")
                .Data("Burger.getSchedulerDataWithoutDateCheck")
            )
        )
    )
    .DataSource(d => d
        .Model(m =>
        {
            m.Id(f => f.XmlId);
            m.Field(f => f.ServiceName).DefaultValue("No title");
            m.Field(f => f.SuggestedUserName);
            m.Field(f => f.Status);
        })
        .Read(read => read
                .Action("AlternativeSchedulerRead", "Scheduler")
                .Data("Burger.getSchedulerDataWithoutDateCheck")
        )
        .ServerOperation(true)
     )
)

Thanks in advance,

Paul

Paul Ridden
Top achievements
Rank 1
Veteran
 answered on 17 Dec 2018
23 answers
737 views

I have a VS2013 telerik mvc project and I have added a Class Library Project which has my DB models. I have already add the reference to my telerik mvc project but when I select the Kendo UI Scaffolding and select one of muy models inside de Class Library Project it always says: 

'There was an error running the selected code generator 'Invalid Model Configuration'

but I don't know what I'm missing. I'm using entity framework 5.0.0 with as the model generator.

 If someone has any idea I'll appreciate it.

Llorenç
Top achievements
Rank 2
 answered on 17 Dec 2018
1 answer
269 views
How do I set the scheduler date to current date in telerik? I have attached screenshot for the date i need to set to current date, Right now it is showing date June 10,2013. Please help.
Eyup
Telerik team
 answered on 17 Dec 2018
1 answer
348 views
I was just wondering if you would be able to give me a list of features that can be implemented into the MVC Chat widget. I have worked through the demo but it is not very robust and just has the chat broadcasting to everyone who has it open. Is there a way to implement things such as private chat sessions, linking to data in the app via chat, chat bot in MVC?(I saw there was a chatbot option in Jquery). Just wanting to know if I can use the MVC Chat for more or if I will have to work with the Jquery Chat.
Dimitar
Telerik team
 answered on 14 Dec 2018
1 answer
559 views

How can I pass data from the client to the Read action for a MultiSelect using virtualization. Here is the declaration of the MultiSelect I'm using:

@(Html.Kendo().MultiSelectFor(model => model.SelectedProjectIds)
    .Filter(FilterType.StartsWith)
    .DataTextField("Name")
    .DataValueField("Id")
    .HtmlAttributes(new { style = "width: 100%" })
    .Placeholder("- Select Project(s) -")
    .DataSource(source =>
    {
        source.Custom()
            .ServerFiltering(true)
            .ServerPaging(true)
            .PageSize(80)
            .Type("aspnetmvc-ajax")
            .Transport(transport =>
            {
                transport.Read("ProjectRead", "ProjectPlan");
            })
            .Schema(schema =>
            {
                schema.Data("Data")
                        .Total("Total"); 
                            });
    })
    .Virtual(v => v.ItemHeight(26))
)

I'd like to pass in some data in the Transport Read. Here is the action method for the Read:

        [HttpPost]
        public ActionResult ProjectRead([DataSourceRequest] DataSourceRequest request)
        {
            return Json((GetProjects() as List<NamedEntity>).ToDataSourceResult(request));
        }

So, in addition to the DataSourceRequest object, I'd like to pass in a string from the client-side. How can this be done?

Dimitar
Telerik team
 answered on 14 Dec 2018
3 answers
546 views

Hello,

I can get the multi filter to display or I can get the row filtering but I can't get both at once. My client is an excel experience heavy user and say the grid displays 700 records. They then want the ability to row filter and say that reduces it down to 350. Then they want to apply column value multi select filters to narrow the 350 down even further.

However I have tried a couple different combinations and while they don't error out I don't get both filters on one grid.

One attempt:

@(Html.Kendo().Grid(Model)
        .Name("grid")
        .Columns(columns =>
        {
            columns.Bound(e => e.A).Filterable(ftb => ftb.Multi(true).Search(true));
            columns.Bound(e => e.B).Filterable(ftb => ftb.Multi(true).Search(true));
            columns.Bound(e => e.C).Filterable(ftb => ftb.Multi(true).Search(true));
            columns.Bound(e => e.D).Filterable(ftb => ftb.Multi(true).Search(true));
            columns.Bound(e => e.E).Filterable(ftb => ftb.Multi(true).Search(true));
        })
        .HtmlAttributes(new { style = "width: 80%;" })
        .DataSource(data => data.Ajax().Model(mdl => mdl.Id(p => p.A) ))
        .Scrollable()
        .Groupable()
        .Sortable()
        .Editable()
        .Filterable(ftb => ftb.Mode(GridFilterMode.Row))
        .Resizable(size => size.Columns(true))
        .Selectable(selectable => selectable.Mode(GridSelectionMode.Multiple))
        .Pageable(pageable => pageable
            .Refresh(true)
            .PageSizes(true)
            .ButtonCount(5))
        )

 

Another attempt:

@(Html.Kendo().Grid(Model)
        .Name("grid")
        .Columns(columns =>
        {
            columns.Bound(e => e.A).Filterable(ftb => ftb.Multi(true).Search(true)).Filterable(ftb => ftb.Mode(GridFilterMode.Row));
            columns.Bound(e => e.B).Filterable(ftb => ftb.Multi(true).Search(true));
            columns.Bound(e => e.C).Filterable(ftb => ftb.Multi(true).Search(true));
            columns.Bound(e => e.D).Filterable(ftb => ftb.Multi(true).Search(true));
            columns.Bound(e => e.E).Filterable(ftb => ftb.Multi(true).Search(true));
        })
        .HtmlAttributes(new { style = "width: 80%;" })
        .DataSource(data => data.Ajax().Model(mdl => mdl.Id(p => p.A) ))
        .Scrollable()
        .Groupable()
        .Sortable()
        .Editable()
        .Filterable()
        .Resizable(size => size.Columns(true))
        .Selectable(selectable => selectable.Mode(GridSelectionMode.Multiple))
        .Pageable(pageable => pageable
            .Refresh(true)
            .PageSizes(true)
            .ButtonCount(5))
        )

 

Thoughts?

JB

Alex Hajigeorgieva
Telerik team
 answered on 13 Dec 2018
1 answer
793 views

I am getting this error "The Type or Namespace name ' GridAction' could not be found" while upgrading the application from version 2011.2.712 to 2018.3.1017.

Please let me know how to solve this error.

Tsvetina
Telerik team
 answered on 13 Dec 2018
1 answer
139 views

Hi,

I am using a hierarchical (master/detail) grid.  After I click to save changes to the detail grid, I would like to update the contents of a particular cell in the master.  This displays summary data from the details grid.  So, after the detail changes have been saved I need to make a server call to grab some data from the database and display it in that cell.  How would I make this call, return the data and display it in my chosen cell in the parent?  I appreciate that I could refresh the entire grid (or page) but would prefer to make an Ajax style update to make the process quicker and slicker.

Many thanks,

Colin

 

Konstantin Dikov
Telerik team
 answered on 13 Dec 2018
Narrow your results
Selected tags
Tags
Grid
General Discussions
Scheduler
DropDownList
Chart
Editor
TreeView
DatePicker
ComboBox
Upload
MultiSelect
ListView
Window
TabStrip
Menu
Installer and VS Extensions
Spreadsheet
AutoComplete
TreeList
Gantt
PanelBar
NumericTextBox
Filter
ToolTip
Map
Diagram
Button
PivotGrid
Form
ListBox
Splitter
Application
FileManager
Sortable
Calendar
View
MaskedTextBox
PDFViewer
TextBox
Toolbar
Dialog
MultiColumnComboBox
DropDownTree
Checkbox
Slider
Switch
Notification
Accessibility
ListView (Mobile)
Pager
Security
ColorPicker
DateRangePicker
Wizard
Styling
Chat
DateInput
MediaPlayer
TileLayout
Drawer
SplitView
Template
Barcode
ButtonGroup (Mobile)
Drawer (Mobile)
ImageEditor
RadioGroup
Sparkline
Stepper
TabStrip (Mobile)
GridLayout
Badge
LinearGauge
ModalView
ResponsivePanel
TextArea
Breadcrumb
ExpansionPanel
Licensing
Rating
ScrollView
ButtonGroup
DropDownButton
CheckBoxGroup
NavBar
ProgressBar
QRCode
RadioButton
Scroller
Timeline
TreeMap
TaskBoard
OrgChart
Captcha
ActionSheet
Signature
DateTimePicker
AppBar
BottomNavigation
Card
FloatingActionButton
Localization
MultiViewCalendar
PopOver (Mobile)
Ripple
ScrollView (Mobile)
Switch (Mobile)
PivotGridV2
FlatColorPicker
ColorPalette
AIPrompt
PropertyGrid
ActionSheet (Mobile)
BulletGraph
Button (Mobile)
Collapsible
Loader
CircularGauge
SkeletonContainer
Popover
HeatMap
Avatar
ColorGradient
CircularProgressBar
SplitButton
StackLayout
TimeDurationPicker
Chip
ChipList
DockManager
ToggleButton
Sankey
OTPInput
ChartWizard
SpeechToTextButton
InlineAIPrompt
TimePicker
StockChart
RadialGauge
ContextMenu
ArcGauge
AICodingAssistant
SmartPasteButton
PromptBox
SegmentedControl
LLM Kit
+? more
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?