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

Is there a way to format the cell contents with strike-through and coloring where only the highlighted text gets the applied format and not the whole text string within the cell? 

Rumen
Telerik team
 answered on 14 Dec 2016
1 answer
489 views

Here is my grid:

 

@(Html.Kendo().Grid<tpnconnect.com.Models.Hub.ForkLiftTruck>()
    .Name("ForkLiftTruckGrid")
    .Columns(columns =>
    {
        columns.Bound(f => f.ForkLiftTruckID).Title("ID").Hidden(true);
        columns.Bound(f => f.Deleted).Title("Deleted");
        columns.Bound(f => f.HubDepotNumber).Title("Depot Number").Locked(true);
        columns.Bound(f => f.HubID).Title("Hub ID").Hidden(true);
        columns.Bound(f => f.TruckNumber).Title("Truck Number");
    })
    .Editable(editable => editable.Mode(GridEditMode.InLine))
            .ToolBar(toolbar => toolbar.Create())
            .Pageable()
            .Sortable()
            .Filterable()
            .Scrollable()
            .HtmlAttributes(new { style = "height:720px;" })
            .DataSource(dataSource => dataSource
                .Ajax()
                .Events(events => events.Error("FLT_Grid_error_handler"))
                .Model(model => model.Id(d => d.ForkLiftTruckID))
                .PageSize(16)
                .ServerOperation(false)
                .Create(update => update.Action("AddForkLiftTruck", "Warehouse"))
                .Read(read => read.Action("GetForkLiftTrucks", "Warehouse").Type(HttpVerbs.Get))
                .Update(update => update.Action("EditForkLiftTruck", "Warehouse"))
            )
)

 

Here's my ForkLiftTruck definition:

 

namespace tpnconnect.com.Models.Hub
{
    public class ForkLiftTruck
    {
        public int ForkLiftTruckID { get; set; }
        public int TruckNumber { get; set; }
        public int HubID { get; set; }
        public string HubDepotNumber { get; set; }
        public bool Deleted { get; set; }
    }
}

 

Here's my controller code:

[HttpGet]
public ActionResult GetForkLiftTrucks([DataSourceRequest]DataSourceRequest request)
{
    int depotID = Utilities.GetUserDepotID();
    List<Models.Hub.ForkLiftTruck> flts = new List<Models.Hub.ForkLiftTruck>();
 
    using (WarehouseService.WarehouseServicesClient ws = new WarehouseService.WarehouseServicesClient())
    {
        var serviceFLTs = ws.GetForkLiftTrucks(depotID);
 
        foreach (var serviceFLT in serviceFLTs)
        {
            Models.Hub.ForkLiftTruck flt = new Models.Hub.ForkLiftTruck()
            {
                Deleted = serviceFLT.Deleted,
                ForkLiftTruckID = serviceFLT.ForkLiftTruckID,
                HubDepotNumber = serviceFLT.HubDepotNumber,
                HubID = serviceFLT.HubID,
                TruckNumber = serviceFLT.TruckNumber
            };
 
            flts.Add(flt);
        }
 
        var data = flts.ToDataSourceResult(request);
        return Json(data, JsonRequestBehavior.AllowGet);
    }
}

 

Attached files:

 

1. screenshot of Chrome's network traffic inspector for the response to the grid's read request

2. screenshot of the Kendo UI listener seeing the data bind event

Graham
Top achievements
Rank 2
Iron
Iron
 answered on 14 Dec 2016
1 answer
197 views

How can i apply an TemplateName or TemplateId to the Edit-Popup-Window of an TreeList?
I've got a partial-view named: MotivTreeViewViewModelEdit and i i want to set it to the Popup Window like in ASP.NET MVC Grid

....Editable(editable => editable.Mode("popup").TemplateName("MotivTreeViewViewModelEdit"))

The HtmlHelper supports the feature but i think it is not renderd.

Kind regards!

Konstantin Dikov
Telerik team
 answered on 14 Dec 2016
1 answer
601 views
I have a grid with around 20,000 items in it and when I click export to excel with .AllPages set to true, I get an unresponsive script error. I've traced the SQL query and that is quick, taking only 1 second to complete but I can see the ajax call taking far too long and ultimately failing after around 15-20 seconds. What are my options for this? Is there an alternative approach involving server-side?
I would guess this is because there are a lot of items in the grid and your example on your demo page only does the current page ?
Rumen
Telerik team
 answered on 13 Dec 2016
4 answers
228 views

Hi!

I'm using a scheduler in cshtml:

@(Html.Kendo().Scheduler<ITSV6.Areas.CoreApp.Models.SchedulerModel>()
            .Name("scheduler")
            .Date(new DateTime(2013, 6, 13))
            .StartTime(new DateTime(2013, 6, 13, 7, 00, 00))
            .MajorTick(60)
            .Views(views =>
            {
                views.TimelineView(timeline => timeline.EventHeight(50));
                views.TimelineWeekView(timeline => timeline.EventHeight(50));
                views.TimelineWorkWeekView(timeline => timeline.EventHeight(50));
                views.TimelineMonthView(timeline =>
                {
                    timeline.StartTime(new DateTime(2013, 6, 13, 00, 00, 00));
                    timeline.EndTime(new DateTime(2013, 6, 13, 00, 00, 00));
                    timeline.MajorTick(1440);
                    timeline.EventHeight(50);
                });
            })
            .Timezone("Etc/UTC")
            .Group(group => group.Resources("SchedulerName", "Employees").Orientation(SchedulerGroupOrientation.Vertical))
            .Resources(resource =>
            {
                resource.Add(m => m.Type)
                    .Title("Type")
                    .Name("Type")
                    .DataTextField("Text")
                    .DataValueField("Value")
                    .DataColorField("Color")
                    .BindTo(new[] {
                    new { Text = "Pay Code", Value = 1},
                    new { Text = "Day Off", Value = 2},
                    new { Text = "Shift", Value = 2}
                    });
                resource.Add(m => m.SchedulerName)
                    .Title("Scheduler Group")
                    .Name("SchedulerName")
                    .DataTextField("sg_name")
                    .DataValueField("sg_group")
                    .DataColorField("Color")
                    .DataSource(source =>
                    {
                        source.Read(read =>
                        {
                            read.Action("getScheduleGroups", "Scheduler");
                        });
                    });
 
                resource.Add(m => m.Employees)
                    .Title("Employees")
                    .Name("Employees")
                    .Multiple(true)
                    .DataTextField("FullNM")
                    .DataValueField("emp_id")
                    .DataColorField("Color")
                    .DataSource(source =>
                    {
                        source.Read(read =>
                        {
                            read.Action("GetEmployees", "Scheduler");
                        });
                    });
            })
    .DataSource(d => d
            .Model(m =>
            {
                m.Id(f => f.SchedulerId);
                m.Field(f => f.Title).DefaultValue("No title");
                m.RecurrenceId(f => f.RecurrenceId);
                m.Field(f => f.Title).DefaultValue("No title");
            })
                //.Read("Read", "Scheduler")
                .Create("Create", "Scheduler")
                .Destroy("Destroy", "Scheduler")
                .Update("Update", "Scheduler")
    )

 

The "Employee" and the "RuleName" are associated by a field called "schedulerId".

I need to group "Employees" with a "SchedulerName" only if the Employee is associated to the SchedulerName just like the attached image.

Also, I need to add an empty line as "Empty Template" for add a new "Schedule Rule" like the first line in the attached image.

 

Its posible to do that with the scheduler?

 

Thanks a lot!

Best regards!

Veselin Tsvetanov
Telerik team
 answered on 13 Dec 2016
3 answers
109 views

Hi Guys

I'm sure this is just a syntax issue.. but I'm stuffed if I can work it out. 

If I set my messages ( for testing only) like this in the editor template it works fine.

<div data-container-For="recurrenceRule" Class="k-edit-field">
    <div data-bind="value:recurrenceRule" name="recurrenceRule" data-role="recurrenceeditor" data-frequencies="['never','daily','weekly']" data-messages="{'frequencies':{'never':'Nie','daily':'Täglich','weekly':'Wöchentlich','monthly':'Monatlich','yearly':'Jährlich'}}"></div>
</div>

 

But if I try to set the data-messages to a javascript variable I can't get it to work. ( I wan't to do this as I want to be able to change the language based on the browser language.. so I want to have an externally defined message object.)

I've tried all sorts of ways to define the variable.. but it never works

  var rmessages = {'frequencies':{'never':'Nie','daily':'Täglich','weekly':'Wöchentlich','monthly':'Monatlich','yearly':'Jährlich'}};
  // var rmessages  = {frequencies:{never:"Nie",daily:"Täglich",weekly:"Wöchentlich",monthly:"Monatlich",yearly:"Jährlich"}};
 
//-------------------------------
<div data-container-For="recurrenceRule" Class="k-edit-field">
        <div data-bind="value:recurrenceRule" name="recurrenceRule" data-role="recurrenceeditor" data-frequencies="['never','daily','weekly']" data-messages="rmessages"></div>
    </div>

 

When I run , it seems that the data-messages are set to 'rmessages'  ( as per the attached image) however is other parts of the same template I refer to javascript variable and this works. ( e.g setting the  'data-source' for this drop down which is on the same template.

<div id="selectsg" style="display:none;">
       <div Class="k-edit-label"><label for="SGIDId">Queue</label></div>
       <div data-container-For="SGID" Class="k-edit-field">
           <input name="SGIDId" type="text" id="SGIDId" data-role="combobox" data-source="sgdataSource" data-text-field="name" data-value-field="id" data-bind="value:SGID" data-placeholder="Select Queue..." data-value-primitive="true" />
       </div>
   </div>

 

Can someone please point out my stupid error in syntax or thinking!  

Many thanks

Rob

 

 

 

asdad

 

Veselin Tsvetanov
Telerik team
 answered on 13 Dec 2016
1 answer
128 views

Hi All,

          please let me know we put dropdownlist in grid as child control?  And how it populate?

Eyup
Telerik team
 answered on 13 Dec 2016
1 answer
367 views
@model IEnumerable<dynamic>
@(
 Html.Kendo().Grid(Model).Name("resgrid")
 .RowAction(row =>
 {
     row.HtmlAttributes["style"] = "background:red;";
 })
 .CellAction(cell =>
 {
              cell.HtmlAttributes["style"] = "background:red;";
 })
 .DataSource(ds => ds.Custom()
    .Transport(t=>t.Read(r =>
    {
        r.Url("../Report/ResultGridRead/" + @ViewBag.ID).DataType("json");
    }))
    )
    .Events(e=>e.DataBinding("DataBinding").DataBound("DataBound"))
)
Kostadin
Telerik team
 answered on 12 Dec 2016
2 answers
611 views

Hi,

Can you use a variable or a Session["variable"] as the ClientDetailTemplateId value? Or does it have to be a hard-coded string? I would like to be able to control the displaying of the detail template based on a user profile setting.  If the user is not allowed to see the details, I'd like to set a variable (or session cookie/variable) to an empty string, otherwise set it to the detail template name.

I already have the detail template working, but would now like to control whether or not it is displayed. When I change the name to an empty string "", the details template does not get displayed, so if I can use a variable for this name, I should be able to get my desired result.

Thanks,
Shawn

Shawn
Top achievements
Rank 1
 answered on 12 Dec 2016
2 answers
240 views

Hello

 

I have a scheduler that I want to filter on 2 different parameters (Team and Factory). With my current implementation I am only able to filter on one of the two. I have a dropdown for the teams and checkbuttons for the factories. So the aim is that you should be able to look at one or all teams AND 1 to all factories. How can I achive this filter?

This is what I got so far:

.Filter(filters =>
   {
     filters.Add(model => model.teamId).IsEqualTo(4).Or().IsEqualTo(5).Or().IsEqualTo(6);
     filters.Add(model => model.factoryId).IsEqualTo(1).Or().IsEqualTo(2).Or().IsEqualTo(3);
    })

Do I even really need this if I want to show everything default on load?

$("#teamDDL").change(function (e) {
        var checked = $.map($("#teamDDL"), function (dropdown) {
            return parseInt($(dropdown).val());
        });
        if (checked == "NaN")
            checked = [4, 5, 6];
        var filter = {
            logic: "or",
            filters: $.map(checked, function (value) {
                return {
                    operator: "eq",
                    field: "teamId",
                    value: value
                };
            })
        };
        var scheduler = $("#scheduler").data("kendoScheduler");
        scheduler.dataSource.filter(filter);
    });
 
$("#factories :checkbox").change(function (e) {
        var checked = $.map($("#factories :checked"), function (dropdown) {
            return parseInt($(dropdown).val());
        });
        var filter = {
            logic: "or",
            filters: $.map(checked, function (value) {
                return {
                    operator: "eq",
                    field: "factoryId",
                    value: value
                };
            })
        };
        var scheduler = $("#scheduler").data("kendoScheduler");
        scheduler.dataSource.filter(filter);
        scheduler.view(scheduler.view().name);
    });

 

So I have 2 functions for updating the filters, one for the dropdown and one for the checkboxes. I need to modify these two functions to do an AND search on both the dropdown value and the checkbox values, how do I do that?

 

BR
Jonas

Jonas
Top achievements
Rank 1
 answered on 12 Dec 2016
Narrow your results
Selected tags
Tags
Grid
General Discussions
Scheduler
DropDownList
Chart
Editor
TreeView
DatePicker
Upload
ComboBox
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
MultiColumnComboBox
Dialog
DropDownTree
Checkbox
Slider
Switch
Notification
ListView (Mobile)
Pager
Accessibility
ColorPicker
DateRangePicker
Wizard
Security
Styling
Chat
MediaPlayer
TileLayout
DateInput
Drawer
SplitView
Barcode
ButtonGroup (Mobile)
Drawer (Mobile)
ImageEditor
RadioGroup
Sparkline
Stepper
TabStrip (Mobile)
GridLayout
Template
Badge
LinearGauge
ModalView
ResponsivePanel
TextArea
Breadcrumb
ExpansionPanel
Rating
ScrollView
ButtonGroup
CheckBoxGroup
NavBar
ProgressBar
QRCode
RadioButton
Scroller
Timeline
TreeMap
TaskBoard
OrgChart
Captcha
ActionSheet
Signature
DateTimePicker
AppBar
BottomNavigation
Card
FloatingActionButton
Licensing
Localization
MultiViewCalendar
PopOver (Mobile)
Ripple
ScrollView (Mobile)
Switch (Mobile)
PivotGridV2
FlatColorPicker
ColorPalette
DropDownButton
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
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?