Telerik Forums
UI for ASP.NET MVC Forum
1 answer
583 views
My code:
.Series(series => {
            series.Column(s => s.XXXXX)
            .Overlay(ChartBarSeriesOverlay.None)            
            .Labels(labels => labels                                     
                .Background("transparent")
                .Template("\n#= dataItem.XXXX#%\n#= dataItem.YYYY#")                
                .Visible(true));           
        })

I want to insert an image into label template. So, how to do it?
Iliana Dyankova
Telerik team
 answered on 13 Mar 2015
1 answer
449 views
Hi,

I am trying to use TextEditor as the EditorTemplate for Grid.  When I click on Edit the column value is not being passed on the editor.  Not sure what I am doing wrong.  Any help is appreciated.

@(Html.Kendo()
      .Grid<WellsRxWeb.Models.UserNotesModel>()
      .Name("gridUserNotes")
      .Columns(columns => {
        columns.Bound(p => p.NotesId).Title("Id").Visible(false);
        columns.Bound(p => p.UserName).Title("UserName").Visible(false);
        columns.Bound(p => p.UserNoteText).Title("Notes").EditorTemplateName("TextEditor");
        columns.Bound(p => p.ModifiedBy).Title("Saved By");
        columns.Bound(p => p.Modified).Title("Saved").Format("{0:MM/dd/yyyy}");
        columns.Command(command => { command.Edit(); command.Destroy(); }).Width(172);
      })
      .ToolBar(toolbar => { toolbar.Create(); })
      .Editable(editable => editable.Mode(GridEditMode.InLine))
      .Pageable()
      .Sortable()
      .Filterable()
      .Pageable(pageable => pageable
                                    .Refresh(true)
                                    .PageSizes(true)
                                    .ButtonCount(5))
      .Filterable()
              .Reorderable(r => r.Columns(true))
        .Resizable(r => r.Columns(true))
        .ColumnMenu()
 
      .DataSource(dataSource => dataSource
                                          .Ajax()
                                          .Model(model => {
                                            model.Id(o => o.NotesId);
                                            model.Field(p => p.UserName).Editable(false);
                                            model.Field(p => p.ModifiedBy).Editable(false);
                                            model.Field(p => p.Modified).Editable(false);                                           
                                          })
                                          .Read(read => read.Action("UserNotes_Read", "User").Type(HttpVerbs.Get).Data("additionalData"))
                                          .Create(create => create.Action("UserNotes_Create", "User").Data("additionalData"))
                                          .Update(update => update.Action("UserNotes_Update", "User").Data("additionalData"))
                                          .Destroy(destroy => destroy.Action("UserNotes_Destroy", "User").Data("additionalData").Type(HttpVerbs.Post))
                                          .Events(events => { events.RequestEnd("gridRequestEnd"); }))
 
)

TextEditor.cshtml
@model WellsRxWeb.Models.UserNotesModel
 
@(Html.Kendo().EditorFor(model => model.UserNoteText)
      .Name("TextEditor")
      .HtmlAttributes(new { style = "width: 740px;height:440px" })
)
Dimo
Telerik team
 answered on 13 Mar 2015
9 answers
386 views
Hello,

 I use scheduler control in my project. It is like that http://demos.telerik.com/aspnet-mvc/scheduler/index
I have problem about double click event on ipad or other tablets for popup window. How I fix it ?
Kiril Nikolov
Telerik team
 answered on 12 Mar 2015
9 answers
493 views
I searched the forum for my issue but the suggestions here (escaping the # with \\ or \\\\) did not work.

  columns.Bound(Function(l) l.Path).Title("File Path").ClientTemplate("<a href=""#= Path.replace('ROOT\\', '\\\\test123.com\\test\\WAV\\Compliance\\') #"" target=""_blank"">#= Path.replace('ROOT\\', '\\\\cmutual.com\\fsroot\\WAV\\Compliance\\') #</a>")

If my Path contains a "#", the link gets cut off after that symbol (and does not open the linked file, obviously). 

Interestingly, when the link is clicked, for a second the whole correct path is in the address bar (with the "#" and everything after it), but after a second, it gets replaced with the cut off path.

Thanks,
Julia
                          
Julia
Top achievements
Rank 1
 answered on 12 Mar 2015
2 answers
269 views
Hello,

I am having an issue with a couple of Kendo grids on our Mvc project. I was on an older version of Kendo, and I thought upgrading to the latest might help, but after upgrading the problem remained the same. What happens is sometimes when I edit a row in the grid, the action will not get hit in the controller at all. When I first load the application, the first couple of edits will often go through (but not always), however once it stops working, it'll never work again until the page has been refreshed (but usually it requires the whole application to be reset). It's been very hard to pin down because no errors are getting thrown in either javascript or asp.net.

We are using a custom template for editing, but I have eliminated this as a possible culprit, because the problem occurs exactly in the same way if I change the edit type to InCell or InLine.

Here is the code:

    @(Html.Kendo().Grid<AttorneyRequestPendingDeterminationViewModel>()
          .Name("PendingDeterminationGrid")
          .DataSource(dataSource => dataSource
              .Ajax()
              .Events(events => events.Error("onError"))
              .Read(read => read.Action("Read", "PendingDetermination").Data("getSearchData"))
              .Model(model => model.Id(p => p.Id))
              .Update(read => read.Action("DecisionsEdit", "PendingDetermination"))
              .Update(read => read.Type(HttpVerbs.Post))
              .PageSize(20)
              .Events(events => events.RequestEnd("onRequestEnd"))
          )
          .Columns(columns =>
          {
              columns.Bound(m => m.DateEntered).Title("Date Entered");
              columns.Bound(m => m.LocalId).Title("Local ID");
              columns.Bound(m => m.DefendantName).Title("Name");
              columns.Bound(m => m.Offense).Title("Offense");
              columns.Bound(m => m.EnteredBy).Title("FQ User ID");
              columns.Bound(m => m.InterviewLocation).Title("Interview Location");
              columns.Bound(m => m.CourtLocation).Title("Court Location");
              columns.Bound(m => m.Recommendation).Title("Recommendation");
              columns.Command(m => m.Edit()).Title("Actions");
          })
          .Editable(edit => edit.Mode(GridEditMode.PopUp).TemplateName("DecisionsTemplate"))
              .Sortable(sortable => sortable
                .Enabled(true)
                .AllowUnsort(false)
                .SortMode(GridSortMode.SingleColumn))
              .Groupable()
              .Pageable()
          .Deferred()
          )

<script type="text/javascript">
    require(['/Content/js/config.js'], function() {
        require(['jquery', 'lib/kendo/kendo.grid.min', 'lib/kendo/kendo.aspnetmvc.min'], function($, kendogrid, kendomvc) {
            @Html.Kendo().DeferredScriptsFor("PendingDeterminationGrid", false)

            function onRequestEnd(e) {
                if (e.type == "update") {
                    location.reload();
                }
            }

            $(".k-link").bind("click", function(e) {
                $('#grid').data('kendoGrid').dataSource.page(1);
            });

            $('#SearchString').keyup(function(event) {
                if (event.keyCode == 13) {
                    $('#SearchButton').click();
                }
            });

            $("#SearchButton").click(
                function() {
                    $('#grid').data('kendoGrid').dataSource.fetch();
                    $('#grid').data('kendoGrid').dataSource.page(1);
                });

            function getSearchData() {
                return {
                    SearchString: $("#SearchString").val(),
                    SearchTypeSelected: $("#SearchTypeSelected").val(),
                };
            };
        });
    });
</script>


And the controller method in case you need it:

[HttpPost]
        public ActionResult DecisionsEdit([DataSourceRequest] DataSourceRequest request,
            AttorneyRequestPendingDeterminationViewModel attorneyRequest)
        {
            string href =
                attorneyRequest.Links.FirstOrDefault(l => l.Rel == Constants.Rels.AttorneyRequestDecisions).Href;
            int val;
            if (attorneyRequest.EligibilityOverrideReason != null && int.TryParse(attorneyRequest.EligibilityOverrideReason.Value, out val))
            {
                attorneyRequest.EligibilityOverrideReasonId = val;
            }
            if (attorneyRequest.NotEligibleReason != null && int.TryParse(attorneyRequest.NotEligibleReason.Value, out val))
            {
                attorneyRequest.NotEligibleReasonId = val;
            }


            var response = HalClient.PutAsJsonAsync(href, attorneyRequest).Result;

            if (!response.IsSuccessStatusCode)
            {
                if (response.StatusCode == HttpStatusCode.NotFound)
                {
                    this.Toast(ToastType.Error, "The attorney request could not be located");
                }
                if (response.StatusCode == HttpStatusCode.BadRequest)
                {
                    this.Toast(ToastType.Error, "The attorney request is invalid");
                }
            } else
            {
                this.Toast(ToastType.Success, "The decisions have been updated");
            }
            return Index();
        }

Please let me know if you need any other information to help nail this down.



Alexander Popov
Telerik team
 answered on 12 Mar 2015
1 answer
97 views
בס"ד

hi ,
i'm using kendo 2012.1.419 version.

I need to delay the auto close grid column menu (of the sub filter window) on mouse out.

How can i do it  ? 

Regards,
Moshe Yariv Malka

Kiril Nikolov
Telerik team
 answered on 12 Mar 2015
1 answer
109 views
Hi Telerikains,

I have a grid with 6 columns and filtering active. The last column width is stretched to fill grid. However the filter control is not drawn correctly. Is there anything I can do to fix this?

@(Html.Kendo().Grid<WebUserViewModel>()
       .Name("WebUsersGrid")
       .HtmlAttributes(new { @class = "js-full-height-grid" })
       .Columns(columns =>
       {
           columns.Bound(c => c.Id).Title("").ClientTemplate(Html.BuildWebUserIcons<WebUserViewModel>(this.User, "WebUsersGrid")).Width(StyleValues.Grid.ThreeIconColWidth).Filterable(x => x.Enabled(false)).Sortable(false).HtmlAttributes(new { style = " text-align:center;" });
 
           columns.Bound(c => c.Id).Visible(false);
           columns.Bound(c => c.AccountId).Visible(false);
 
           columns.Bound(c => c.Active)
               .ClientTemplate(Html.ClientTemplate_ActiveImg())
               .Width(100)
               .HtmlAttributes(new { style = " text-align:center;" });
 
           columns.Bound(c => c.UserNameWithinAccount).Title("User Name").Filterable(filterable => filterable.UI("NameFilter")).Width(200);
           columns.Bound(c => c.FirstName).Width(200);
           columns.Bound(c => c.LastName).Width(200);
           columns.Bound(c => c.Email);
       })
       .ToolBar(toolbar =>
       {
           toolbar.Create().Text("Add Web User");
       })
       .Filterable(filterable => filterable
           .Extra(false)
           .Mode(GridFilterMode.Row)
           .Messages(x => x.IsFalse("N"))
           .Messages(x => x.IsTrue("Y"))
           .Operators(operators => operators
               .ForString(str => str.Clear()
                   .Contains("Contains")
                   .DoesNotContain("Does Not Contain")
                   .StartsWith("Starts with")
                   .IsEqualTo("Is equal to")
                   .IsNotEqualTo("Is not equal to")
               )
           )
       )       
       .Scrollable()
       .Sortable()
       .Pageable(pageable => pageable
           .Refresh(true)
           .PageSizes(true)
           .ButtonCount(5)
       )
   )

Thanks,

Paul Ridden
Top achievements
Rank 1
Veteran
 answered on 12 Mar 2015
1 answer
126 views
I have grid with a column bound like this...

cols.Bound(m => m.Location).Filterable(fl => fl.Cell(c => c.Template("locationFilter").Operator("equals").ShowOperators(false)));

and some javascript..

var locationList = [
                        {text: "Atlanta", value: "ATL"},
                        {text: "Houston", value: "HOU"},
        ];
function locationFilter(container) {
            container.element.kendoDropDownList({
                dataTextField: "text",
                dataValueField: "value",
                optionLabel: { text: "-ALL-", value: "" },
                dataSource: { data: locationList, },
            });
        }

This seems to initialize correctly showing '-ALL-' with no filter applied.  But as soon as I select something in the dropdownlist it immediately changes the selection back to "-ALL-" and filters out all the items.

However, if I change it to this and use strings for the data instead of objects, it lets me select items and applies the filters ok but the display isn't optimal...

function locationFilter(container) {
            container.element.kendoDropDownList({
                optionLabel: "-ALL-",
                dataSource: {data: ["ATL", "HOU"],},
            });
        }

Am I doing something wrong when trying to use objects in the datasource for the custom filter, or is there a bug?
Alexander Popov
Telerik team
 answered on 12 Mar 2015
6 answers
398 views
I have a Kendo scheduler template and on the template I want to give the user a multiple check box selection of work group data to choose from. I want to be able to bind the choices of work group data from a property on my model (ScheduleDataSource) which is the following: List<string> AllWorkgroups {get; set;}I then want the choice from the user to be saved in List<String> UserWorkgroups {get; set;} on the same model.Can someone please help with how to do this. Please note I am doing this in MVC ASPX. My current code is below:

<%=Html.Kendo().Scheduler<ASML_Scheduler.Models.ScheduleDataSource>()
.Name("scheduler")
.Date(DateTime.Now)
.StartTime(new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, 7, 00, 00))
.Height(400)
.Editable(editable=>editable.TemplateId("editor"))

.DateHeaderTemplate("<p class='HeaderTemplate'>#=kendo.toString(date, 'ddd dd MMM')#</p>")
.MajorTimeHeaderTemplate("<p class='HeaderTemplate'>#=kendo.toString(date, 'H:mm' )#</p>")
.EventTemplateId("event-template")
.Views(views =>
{
views.DayView();
views.WeekView(weekView =>
{
weekView.Selected(true);
weekView.WorkDayCommand(false);
weekView.AllDaySlot(false);
});

views.MonthView();
})

.CurrentTimeMarker(true)
.Timezone("Etc/UTC")
.DataSource(d => d
.Model(m =>
{
m.Id(f => f.ScheduleId);
m.Field(f => f.Description).DefaultValue("No title");
m.Field(f => f.UserId).DefaultValue(1);
m.Field(f => f.End).DefaultValue(DateTime.Now);
m.Field(f => f.Workgroups);
})

.Read("Read", "Schedule")
.Create("Create", "Schedule")
.Destroy("Destroy", "Schedule")
.Update("Update", "Schedule")
.PageSize(600)

)
.GroupHeaderTemplate("<div style='color:blue'>" +
"</div>")
.Events(events =>
{
events.Edit("scheduler_edit");
})

%>

<script id="editor" type="text/x-kendo-template">

<input name="start" type="text" required data-type="date" data-role="datetimepicker" data-bind="value: start" />
<br />
<input name="end" type="text" id="datetimepickers" required data-type="date" data-role="datetimepicker" data-bind="value: end" />

</script>

I have a Kendo scheduler template and on the template I want to give the user a multiple check box selection of work group data to choose from. I want to be able to bind the choices of work group data from a property on my model (ScheduleDataSource) which is the following: List AllWorkgroups {get; set;}

I then want the choice from the user to be saved in List UserWorkgroups {get; set;} on the same model.

Can someone please help with how to do this. Please note I am doing this in MVC ASPX. My current code is below:

Vladimir Iliev
Telerik team
 answered on 12 Mar 2015
1 answer
337 views
I have a partial view in a Window. 

@model Umki2.Areas.Fbr.Models.FbrFitUp
 
 
            @(Html.Kendo().DatePicker()
              .Name("FitUpDate")
              .Value("10/10/2011")
              .HtmlAttributes(new { style = "width:150px" })
            )

From the main view, i open the window with jquery function.

function OpenFitUpForm(e) {
        e.preventDefault();
        var dataItem = this.dataItem($(e.currentTarget).closest("tr"));
        var wnd = $("#PopUpForm").data("kendoWindow");
        $("#PopUpForm").kendoWindow({
            content: {
                url: "/wlb/wlbexplorer/_FitUpForm",
                data: { id: dataItem.Id },
            },
            width: 500,
            title: "FitUp Report",
            modal: true,
            visible: false,
            draggable: true,
        });
        wnd.center().open();
    }


But the result as seen in the attachment. 
Dimo
Telerik team
 answered on 12 Mar 2015
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
Ambisoft
Top achievements
Rank 2
Iron
Pascal
Top achievements
Rank 2
Iron
Matthew
Top achievements
Rank 1
Sergii
Top achievements
Rank 1
Iron
Iron
Andrey
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Ambisoft
Top achievements
Rank 2
Iron
Pascal
Top achievements
Rank 2
Iron
Matthew
Top achievements
Rank 1
Sergii
Top achievements
Rank 1
Iron
Iron
Andrey
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?