Telerik Forums
Kendo UI for jQuery Forum
2 answers
161 views
Hello again,

if i have a kendo DatePicker
and i get the value of that something like that:
var startDate = $(employee.currentStartDate).data("kendoDatePicker").value().toString();
i send to the server as a string,but i try to parse this date in .net C#
i tried something like

 public ActionResult GetEndDateValues(string startDate)
        {
          
            DateTime contractVersionStartDate = DateTime.ParseExact(startDate, "g", null); also i tried G,D,d,still not recognized
}
if on the client,i put toUTCString(),or toISOString(), then the date is 2 hour behind,so i get the yesterday date(ex. 26.11.2013,i get 25.11.2013 22:00:00 pm)
is not ok.
so can you help me clarify this?
i want no matter what local culture is,to send it from client,and parse right on the server.

Best Regards,
Daniel

P.S:if i enter in my telerik account,and i click on a post,no longer sends me to my post,i have to look over it,in the whole kendo forum.before it wasn't like that.
Daniel
Top achievements
Rank 1
 answered on 28 Nov 2013
2 answers
400 views
Hello,

I am trying to use the kendo validation with a set of radio buttons inside of a kendo template.  i've been able to validate whether or not there is at least one radio button selected per set but I cannot seem to get the validation tooltip to be located where I want it to.  Basically each template item has a radio button list with each items name and id set to the same value.  When the validation fires it places the tooltip in the first radio button list items label area.  I'd like it to be above the list of radio button items.  Please see my code below:

<div id="kendo-content" class="k-content">
        <div id="divSubgroups" style="border: none; border-top: 1px dashed #ccc;" data-bind="source: lstSubgroups" data-template="SubgroupTemplate"></div>
    </div>

    <script type="text/x-kendo-template" id="SubgroupTemplate">
        <div class="item">
            <div class="left">
                <h3>#:Name#</h3>
                <br />
                <p>Current Due: <strong>#:kendo.toString(AmountOwed, "c")#</strong></p>
                <br />
                <p><button id="btnAddPaymentAccount" type="button" class="Orange">Add Payment Account</button>
        
        
            </div>
            #if(Accounts.length > 0){#
                <div style="float: right">
                    <h3>Select Payment Account:</h3>
                    <span class="k-invalid-msg" data-for="radio#:ID#"></span>
                    <ul style="margin: 0;" data-bind="source: Accounts" data-template="AccountTemplate"></ul>
                    <br />
                    <span class="left"><button id="btnEditPaymentAccount" type="button" onclick="Validate('#:ID#');">Edit Account</button></span>            
                    <span style="float: right"><button id="btnPayBill" type="button" onclick="Validate('#:ID#');">Pay Bill</button></span>
                </div>
            #}#
            <div style="clear: both;"></div>
        </div>
    </script>

    <script type="text/x-kendo-template" id="AccountTemplate">
        <li>
            <label>
                <input type="radio" id="radio#:ParentID#" name="radio#:ParentID#" value="#:ID#" />
                #:Descriptor#
            </label>
        </li>
    </script>
    <script>
        function Validate(id)
        {
            var validator = $("#radio" + id).kendoValidator({
                rules: {
                    custom: function (input) {
                        var v = $("#radio" + id + ":checked").length;
                        return v > 0;
                    }
                },
                messages: {
                    custom: "Please select a payment account to continue."
                }
            }).data("kendoValidator").validate();
        }
    </script>

The data model for this is as follows:
lstSubgroups:
[
    {
        ID:"P001",
        Name:"Test Name 1",
        AmountOwed:200,
        Accounts: [
                        { ParentID:"P001", ID:9318, Descriptor:"Personal Card #1" },
                        { ParentID:"P001", ID:9319, Descriptor:"Personal Card #2" },
                        { ParentID:"P001", ID:9320, Descriptor:"Personal Card #3" }
                  ]
    },
    {
        ID:"P002",
        Name:"Test Name 2",
        AmountOwed:100,
        Accounts: [
                        { ParentID:"P002", ID:1515, Descriptor:"Company Card #1" },
                        { ParentID:"P002", ID:2356, Descriptor:"Company Card #2" }
                  ]
    },
    {
        ID:"P003",
        Name:"Test Name 3",
        AmountOwed:500,
        Accounts: [
                        { ParentID:"P003", ID:2342, Descriptor:"Parents Card #1" },
                        { ParentID:"P003", ID:1122, Descriptor:"Parents Card #2" },
                        { ParentID:"P003", ID:786, Descriptor:"Parents Card #3" }
                  ]
    }
]

I've tried adding "<span class="k-invalid-msg" data-for="radio#:ID#"></span>" but it doesn't seem to have any effect.

Your help is greatly appreciated!
Matt
Mathew
Top achievements
Rank 1
 answered on 27 Nov 2013
4 answers
263 views
I'm using the PHP wrappers to generate a mildly complex tabstrip based form.  In Chrome and Firefox the tabstrip initially renders with all of the tabs as one long unformatted div before refreshing itself a second or two later and displaying correctly. In both Opera and IE (yeah IE) it renders correctly without the initial hiccup

Test page: http://raymondandrews.com/crftest
Source: http://raymondandrews.com/crftest/index.txt

I'm not loading tabs with ajax or from a database, right now it's all manually configured
Raymond
Top achievements
Rank 1
 answered on 27 Nov 2013
10 answers
232 views
Can someone please guide me to the documentation for all the 'data' attributes supported on the grid for use in MVVM.  I have guessed at a few and saw some in samples.  I need the full list please

I am using these:
 data-role="grid" 
 data-bind="source: gridSource"
 data-columns='ProductName'
 data-sortable='true'
 data-editable='inline'

I guessed at  'data-sortable' and it worked.  I tried  'data-filterable' but it did NOT work. No filter icons appeared in the column headers.  So is filtering supported in the MVVM grid?  whats the 'data' attribute for this?

Thanks
-Jonathan

Jacques
Top achievements
Rank 2
 answered on 27 Nov 2013
5 answers
691 views
Hello,

A while a go, posted this question about how to select a row after a grid refresh.

The answer given back then was a great workaround.  However, once deployed in production with large amount of data, I realized many client's grid were not loaded within 50 milliseconds, leaving the first row unselected.

Increasing the delay might fix the problem for some people but how long should we wait to make sure every grids are loaded?  In the other hand, I don't want to add transform my problem into unnecessary.

What's missing here is an event triggered by the Grid.

Is there a way to create an event named DataBounded (or AfterDataBound) that would fired once the grid will complete the loading of the data received from the dataSource?

Best regards,

Simon
Daniel
Telerik team
 answered on 27 Nov 2013
2 answers
560 views
Hi All

I'm trying to get the Kendo Grid to display with a hierarchical row displaying history data for a given row.
My colleague has setup the project with the primary model having a  one to many relationship to the second model.
Models are as follows:
public class CrossReferenceRelationship
    {
        public int Id { get; set; }
        [Display(Name = "From Partner")]
        public string FromPartner { get; set; }
        [Display(Name = "To Partner")]
        public string ToPartner { get; set; }
        [Display(Name = "From Role")]
        public string FromRole { get; set; }
        [Display(Name = "From Account")]
        public string FromAccount { get; set; }
        [Display(Name = "To Account")]
        public string ToAccount { get; set; }
        [Display(Name = "Is Deleted")]
        public bool IsDeleted { get; set; }
        public ICollection<CrossReferenceRelationshipHistoricEntry> HistoricEntries { get; set; }
    }

public class CrossReferenceRelationshipHistoricEntry
{
    public int Id { get; set; }
    public int XrefId { get; set; }
    [Display(Name = "From Partner")]
    public string FromPartner { get; set; }
    [Display(Name = "To Partner")]
    public string ToPartner { get; set; }
    [Display(Name = "From Role")]
    public string FromRole { get; set; }
    [Display(Name = "From Account")]
    public string FromAccount { get; set; }
    [Display(Name = "To Account")]
    public string ToAccount { get; set; }
    [Display(Name = "Action Type")]
    public string ActionType { get; set; }
    [Display(Name = "Method Used")]
    public string MethodUsed { get; set; }
    [Display(Name = "Modified By")]
    public string ModifiedBy { get; set; }
    [Display(Name = "Modified Datetime")]
    public DateTime ModifiedDatetime { get; set; }
}
He then maps these using EntityMapper, populating these objects.
So far my view contains the following code for the Kendo grid:
@(Html.Kendo()
    .Grid(Model)
    .Name("adminGrid")
    .Columns(columns =>
    {
        columns.Bound(crr => crr.Id).Filterable(false).Width(100);
        columns.Bound(crr => crr.FromPartner).Width(200);
        columns.Bound(crr => crr.FromAccount).Width(200);
        columns.Bound(crr => crr.ToPartner).Width(200);
        columns.Bound(crr => crr.ToAccount).Width(150);
        columns.Command(command => { command.Edit(); command.Destroy(); }).Width(180);
    })
    .ToolBar(toolbar => toolbar.Create())       
    .Editable(editable => editable.Mode(GridEditMode.InLine))
    .Pageable()
    .Sortable()
    .Scrollable()
    .ClientDetailTemplateId("HistoricEntries")
    .Filterable()
    .HtmlAttributes(new { style = "height:430px;" })
    .Events(events => events.DataBound("dataBound"))
    .DataSource(dataSource => dataSource
        .Ajax()
        .PageSize(20)
        .Events(events => events.Error("error_handler"))
        .Model(model => model.Id(crr => crr.Id))
        .Create(update => update.Action("Partner_Create", "CrossReferenceRelationship"))
        .Read(read => read.Action("Read", "CrossReferenceRelationship"))
        .Update(update => update.Action("Update", "CrossReferenceRelationship"))
        .Destroy(update => update.Action("Delete", "CrossReferenceRelationship"))
        )
    )
    <script id="HistoricEntries" type="text/kendo-tmpl">
    @(Html.Kendo().Grid<CrossReferencePortal.Models.CrossReferenceRelationshipHistoricEntry>()
        .Name("historyGrid_#=Id#")
        .Columns(columns =>
        {
            columns.Bound(he => he.FromPartner);
            columns.Bound(he => he.FromAccount);
            columns.Bound(he => he.ToPartner);
            columns.Bound(he => he.ToAccount);
            columns.Bound(he => he.FromRole);
            columns.Bound(he => he.ActionType);
            columns.Bound(he => he.MethodUsed);
            columns.Bound(he => he.ModifiedBy);
            columns.Bound(he => he.ModifiedDatetime);
        })
        .DataSource(dataSource => dataSource
            .Ajax()
            .PageSize(5)
            .Read(read => read.Action("HistoryRead", "CrossReferenceRelationship", new { Id = "#=Id#" }))
        )
        .Pageable()
        .Sortable()
        .ToClientTemplate()
    )
    </script>
I feel I should be able to bind the history grid to the primary grid's Model, so that I can simple expose the HistoricEntries e.g. 
crr.HistoricEntries

Is this possible and are there any examples showing something similar?

Many thanks
Christian
Christian
Top achievements
Rank 1
 answered on 27 Nov 2013
1 answer
55 views
Hi All,

I was trying to move the valueAxis to the minimum value, however this is not working when the data is an object compared to the examples where it uses data arrays.  Is there a way to move the axis with this kind of configuration?  Please see the following jsFiddle:

http://jsfiddle.net/kousei2040/D42M6/10/

Thanks in advance.
Iliana Dyankova
Telerik team
 answered on 27 Nov 2013
1 answer
773 views
Hi ,

I am facing an issue to select a dropdown value using selenium. Please suggest how can we automate to select kendo ui dropdown value using selenium.


Petur Subev
Telerik team
 answered on 27 Nov 2013
7 answers
761 views
Dear Support Team,

I'm new for Kendo UI Grid. For the moment, I enable "Filterable, groupable, sortable and reorderable" at the grid. And I do refresh the grid every 3 minutes to get the latest data. But if the user do Filter or Reorder or sorting or grouping at the grid, I don't want to effect that setting when the grid has been auto refresh is on.
Currently all the setting are gone after refresh. Is there any way not to lost such setting?

Here is part of my code :

var grdTmp = grdReport.data("kendoGrid");
grdTmp.destroy();
grdReport.empty();
grdReport.kendoGrid({
dataSource: {
                data: vMenuData,
                pageSize: 20 //To replace with Header Value
            },
dataBound: onMenuDataBound,
reorderable: true,
groupable: true,
sortable: true,
selectable: "row",
filterable: true,
pageable: {
                refresh: true,
                pageSizes: true
            },
columns: vMenuHead,
schema: vMenuSchema
});    
    
Thanks & Regards




Alexander Valchev
Telerik team
 answered on 27 Nov 2013
1 answer
416 views
Is it possible to replace the validation message with my own image? I would like to provide an image and set it's title to the validation message. If there is a way to provide a validation message template, that would be great.


Thanks!
Rosen
Telerik team
 answered on 27 Nov 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Anislav
Top achievements
Rank 6
Silver
Bronze
Bronze
Jianxian
Top achievements
Rank 1
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Jim
Top achievements
Rank 2
Iron
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Anislav
Top achievements
Rank 6
Silver
Bronze
Bronze
Jianxian
Top achievements
Rank 1
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Jim
Top achievements
Rank 2
Iron
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?