Telerik Forums
UI for ASP.NET MVC Forum
2 answers
292 views
Hi,

I'm using nested grid. In child grid i'm using datepicker. followed as per the below reference link.

http://www.telerik.com/forums/nested-clienttemplate-not-working#OXkDhzlO9UCTmHNzIuvH2A

after that i'm having below issues:-
Values are not binding in the datepicker
script text is printing in grid datepicker cells
when i try to select the date then date selecting icon missing.

Please refer the attachment for the screenshot.

here is my code.

 columns.Bound(a => a.EffStartDate).Width(130).HtmlAttributes(new
                {
                    @class = "templateCell"

                }).ClientTemplate(
                Html.Kendo().DatePicker()
                .Name("FDPickerSD_\\#=AllocationID\\#")
                .Format("{0:dd/MM/yyyy}")
                .HtmlAttributes(new { data_bind = "value:EffStartDate" })
                .Deferred()
                .ToClientTemplate().ToHtmlString() +
                    "<div class=\"scripts\">" +
                        Html.Kendo().DeferredScripts(false).ToString().Replace("jQuery(\"\\#", "jQuery(\"\\\\\\#") +
                    "</div>"
                ).Format("{0:dd/MM/yyyy}");
*************************************************************************************************************************************
                columns.Bound(a => a.EffEndDate columns.Bound(a => a.EffStartDate).Width(130).HtmlAttributes(new
                {
                    @class = "templateCell"

                }).ClientTemplate(
                Html.Kendo().DatePicker()
                .Name("FDPickerSD_\\#=AllocationID\\#")
                .Format("{0:dd/MM/yyyy}")
                .HtmlAttributes(new { data_bind = "value:EffStartDate" })
                .Deferred()
                .ToClientTemplate().ToHtmlString() +
                    "<div class=\"scripts\">" +
                        Html.Kendo().DeferredScripts(false).ToString().Replace("jQuery(\"\\#", "jQuery(\"\\\\\\#") +
                    "</div>"
                ).Format("{0:dd/MM/yyyy}");

                columns.Bound(a => a.EffEndDate).Width(130).HtmlAttributes(new
                {
                    @class = "templateCell"

                }).ClientTemplate(
                Html.Kendo().DatePicker()
                .Name("FDPickerED_\\#=AllocationID\\#")
                .Format("{0:dd/MM/yyyy}")
                .HtmlAttributes(new { data_bind = "value:EffEndDate" })
                .Deferred()
                .ToClientTemplate().ToHtmlString() +
                    "<div class=\"scripts\">" +
                        Html.Kendo().DeferredScripts(false).ToString().Replace("jQuery(\"\\#", "jQuery(\"\\\\\\#") +
                    "</div>"
                );).Width(130).HtmlAttributes(new
                {
                    @class = "templateCell"

                }).ClientTemplate(
                Html.Kendo().DatePicker()
                .Name("FDPickerED_\\#=AllocationID\\#")
                .Format("{0:dd/MM/yyyy}")
                .HtmlAttributes(new { data_bind = "value:EffEndDate" })
                .Deferred()
                .ToClientTemplate().ToHtmlString() +
                    "<div class=\"scripts\">" +
                        Html.Kendo().DeferredScripts(false).ToString().Replace("jQuery(\"\\#", "jQuery(\"\\\\\\#") +
                    "</div>"
                );

Rosen
Telerik team
 answered on 02 Oct 2014
3 answers
292 views
Hi.

I'm having a small issue with a DropDownList using server filtering. I have added a DropDownList with server filtering, and it is working as it should. My issue is that I have some checkboxes that should influence the result of the filtering. The problem is that when I have clicked the DropDownList it caches the result the next time I click it, until I type some text for the text filter.

Here is how it now works.

1) As you can see in Fig1 of the attached files, the first time I click it, it returns 1260 results
2) I then check the CheckBox "Choice1" and then click the DropDownList again, it still shows 1260 results (is supposed to be 383) and the data read method in the controller is not even triggered.

Is there some way I can get the DropDownList not to cache the results on the click, so that each time it is clicked the data read method is called?

Here's from the cshtml file:

@(Html.Kendo().DropDownListFor(m => m.Lines[i].Product.Id)
                                                      .DataTextField("Value")
                                                      .DataValueField("Id")
                                                      .OptionLabel(" ")
                                                      .AutoBind(false)
                                                      .Text(Model.Lines[i].Product.Description)
                                                      .Filter("contains")
                                                      .DataSource(source =>
                                                      {
                                                          source.Read(read =>
                                                          {
                                                              read.Action("SearchProductLandingNote", "ReportSearchResultSurface");
                                                          })
                                                          .ServerFiltering(true);
                                                      }))

And here's from the backing controller:

        public JsonResult SearchProductLandingNote(string text)
        {
            SurofiUser sUser = UserUtilities.GetLoggedInUser();

            var products = RegisterUtilities.Instance.Products.Where(ca => ca.Description != null || ca.Code != null).ToList();

            //
            // Some code that filters from the checkboxes, the info from the checkboxes are stored on the User
            // Checked in debugging and works fine when the method is actually called
            //

            return Json(products, JsonRequestBehavior.AllowGet);
        }

Odd Veibust
Top achievements
Rank 1
 answered on 02 Oct 2014
2 answers
152 views
Symptom
the validation bubbles for my grid show up on the wrong column if I use a commands column

When I try to add a row, the <Required()> validations are executed from the client as expected, but the validation bubble's arrow is pointing to the wrong column.  If I put the command column before the bound columns, the validation message appears one column too far to the right.  If I put the command column after the bound columns, the validation message appears one column too far to the left. 


Model
I've decorated my model with validation attributes, eg....

Public Class AppraiserMetaData
    Public Property AppraiserId As System.Guid

    <Required()>
    Public Property sAMAccountName As String

    <Required()>
    Public Property AppraiserSpecialtyName As String

    <Required()>
    <StringLength(2)>
    Public Property AppraiserTypeAbbrev As String

    <Required()>
    Public Property EmployeeTypeName As String

    <Required()>
    Public Property StateAbbrev As String

    <Required()>
    Public Property CountyName As String
End Class




View
    @Code
        Html.Kendo().Grid(Of InternalAppraisal.Entities.Appraiser)() _
        .Name("AppraiserGrid") _
        .Columns(
            Sub(c)
                    c.Command(Function(cmds)
                                      cmds.Edit()
                                      cmds.Destroy()
                                      Return cmds
                              End Function)
                    c.Bound(Function(p) p.FirstName).Title("First")
                    c.Bound(Function(p) p.LastName).Title("Last")
                    c.Bound(Function(p) p.AppraiserSpecialtyName).Title("Specialty")
                    c.Bound(Function(p) p.AppraiserTypeAbbrev).Title("Appraiser Type")
                    c.Bound(Function(p) p.CountyName).Title("County")
                    c.Bound(Function(p) p.EmployeeTypeName).Title("Type")
                    c.Bound(Function(p) p.sAMAccountName).Title("sAMAccountName")
                    c.Bound(Function(p) p.StateAbbrev).Title("State")
            End Sub) _
        .DataSource(
            Function(d)
                    Return d _
                        .Ajax() _
                        .Model(Function(model)
                                       model.Id(Function(aprsr As InternalAppraisal.Entities.Appraiser) aprsr.AppraiserId)
                                       model.Field(Function(aprsr) aprsr.AppraiserId).Editable(False).DefaultValue(Guid.NewGuid())
                                       model.Field(Of String)("FirstName").Editable(False)
                                       model.Field(Of String)("LastName").Editable(False)
                                       Return (model)
                               End Function) _
                        .Create(Function(c) c.Action("Appraiser_Create", "Appraiser")) _
                        .Read(Function(r) r.Action("Appraisers_Read", "Appraiser")) _
                        .Update(Function(u) u.Action("Appraiser_Update", "Appraiser")) _
                        .Destroy(Function(de) de.Action("Appraiser_Delete", "Appraiser")) _
                        .Events(
                            Function(events)
                                    Return events.Error("error_handler")
                            End Function)
            End Function) _
        .ToolBar(Function(t) t.Create()) _
        .Sortable() _
        .Scrollable() _
        .Filterable() _
        .Render()
    End Code

Is this a bug in one of telerik's libraries, or did I fail to overload something?

In the event that this is a bug in one of telerik's libraries, what is the recommended technique for suppressing the validation bubble, and instead, displaying the validation messages in an area similar to a validation summary?

Thanks,

Jason

Alexander Popov
Telerik team
 answered on 02 Oct 2014
1 answer
5.1K+ views
I just migrated from the ASP.NET MVC controls, and would like to have the refresh button show on the bottom of the grid like it did in the old controls, is this possible with kendo?

Thanks
Iliana Dyankova
Telerik team
 answered on 02 Oct 2014
9 answers
912 views
I have a view model like:
1.public class MyViewModel
2.{
3.    public string PhoneModel { get; set; }
4.}

That is currently rendered on my view as:
1.@model MyViewModel
2. 
3.@Html.EditorFor(model => model.PhoneNumber)

With yesterday's official release of the MaskedTextBox control, I am attempting to update my view to use it instead like:
1.@model MyViewModel
2. 
3.@(Html.Kendo().MaskedTextBoxFor(model => model.PhoneNumber).Mask("(999) 000-0000"))

Unfortunately, VS is complaining "Cannot implicitly convert type 'string' to 'int?'" and the view throws the same compilation error.

Looking at the following WidgetFactory metadata, the MaskedTextBoxFor is trying to return its value as an int?
1.//
2.// Summary:
3.//     Creates a new Kendo.Mvc.UI.MaskedTextBox.
4.public virtual MaskedTextBoxBuilder MaskedTextBoxFor(Expression<System.Func<TModel, int?>> expression);

Phone numbers are typically too big of numbers to be represented by int, not that I would want to incur the overhead of doing so even if it was possible.  Are there any plans to update the helper to return the model's data type rather than hard-coding the return type to int? ?
Georgi Krustev
Telerik team
 answered on 02 Oct 2014
5 answers
164 views
See Attachment, the paging inside the grid of the child somehow goes to the new line for Refresh.  I have  grid which has a child grid, the child grid paging is showing double line.  This paging is fine for IE and Chrome.
Vladimir Iliev
Telerik team
 answered on 02 Oct 2014
4 answers
167 views
Hi Telerik,

I have this requirement that I want to load the details of my a row using your clientemplateid.
I already created my template and it is a kendo tabstrip. it has an item loaded from a partial view here is the code

@(Html.Kendo().TabStrip()
            .Name("tabStrip_#=RowID#")
            .SelectedIndex(0)
            
            .Animation(animation => animation.Open(open => open.Fade(FadeDirection.In)))
            .Items(items =>
            {

                items.Add().Text("Profile Information")
                    .LoadContentFrom("GetPartialApplicantProfile", "SearchProfile", new { rowid = "#=RowID#" })
                    .Selected(true);
                
            })
            .Events(s => s.ContentLoad("DetailLoaded"))
            .ToClientTemplate())

the problem with this is on the initial load of the template when i expand a row it displays the detail perfectly. And after a second the next row below it overriding the display of the template. Why is that happening? Is it the row doesnt detect the size of my template when i loaded it partially?



Mhars
Top achievements
Rank 1
 answered on 02 Oct 2014
1 answer
103 views
Okay so lets try to explain what situation I'm correctly involved in.

I have a Kendo().Grid<>  that is bound to a Dependant Model.

I have a EditorTemplate of the fields required for the editing of this Grids columns within a Popup window. This template has a few dropdowns that get populated with a remote datasource. The normal textboxes updates the model within the grid while the dropdown simply refuses to do so.

I already tried the ValuePrimitive but to no Avail.

Help Please
Nikolay Rusev
Telerik team
 answered on 01 Oct 2014
1 answer
157 views
In my scheduler, I have, as a part of the definition:

.EventTemplate(
       "<p>" +
       "#= kendo.toString(start, 'MMM dd yyyy hh:mm t') # (#= kendo.toString(new Date(end.getTime()-start.getTime()).getHours()) #) #= title#" +
        "</p>")
 

then this runs, I get 

<p>Sep 29 2014 12:00 t (20) Smith, John</p>


20 hours is the value I get for a one hour meeting.
21 hours is the value I get for a two hour meeting.

I would have expected 1 and 2 hours, respectively...

How do I properly calculate total hours between two DateTime values in javascript MVVM?

Vladimir Iliev
Telerik team
 answered on 01 Oct 2014
1 answer
664 views
Hi,

I'm trying to create a cascading drop down list where the child (Order) is still enabled when the parent (Customer) has not been selected, as non selection means All Customers. i.e. the parent is the filter, so when its set to a particular value, the child shows the Orders that belong to that Customer, but when its not selected, the child should show all Orders.

I have tried setting AutoBind to true, but that doesn't seem to help.

Is this possible?

Thanks,

Chris

@(Html.Kendo().DropDownList()
    .Name("Order")
    .DataTextField("Text")
    .DataValueField("Value")
    .DataSource(source =>
    {
        source.Read(read =>
        {
            read.Action("OrderList", "List")
                .Data("filterOrders");
        })
        .ServerFiltering(true);
    })
    .OptionLabel("Please Select")
    .AutoBind(true)
    .CascadeFrom("Customer")
    .Enable(true)

Script
function filterOrders() {
    return {
        customerID: $("#Customer").val()
    };
}

Georgi Krustev
Telerik team
 answered on 01 Oct 2014
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
MultiColumnComboBox
Dialog
DropDownTree
Checkbox
Slider
Switch
Notification
Accessibility
ListView (Mobile)
Pager
ColorPicker
DateRangePicker
Wizard
Security
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
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
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
Bohdan
Top achievements
Rank 3
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Elliot
Top achievements
Rank 1
Iron
Iron
Iron
Sunil
Top achievements
Rank 1
Cynthia
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Bohdan
Top achievements
Rank 3
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Elliot
Top achievements
Rank 1
Iron
Iron
Iron
Sunil
Top achievements
Rank 1
Cynthia
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?