Telerik Forums
UI for ASP.NET MVC Forum
1 answer
72 views
How could I get the selected data of a kendo grid and send them to controller for being read? How could I get it with the corresponding ViewModel?
Daniel
Telerik team
 answered on 10 Dec 2013
1 answer
51 views
I have several filter options in a kendo grid and I need to get data from the controller after being filtered. How could I do that?
Vladimir Iliev
Telerik team
 answered on 10 Dec 2013
1 answer
102 views
I’m trying to set a common value in the “Message” parameter of the “IsEqualTo” property in a kendo grid. My project is Multilanguage, so, when I select a language different than “English”, the shown message is different than “Es igual a”. What should I do to fix that? This is the piece of code:

        .Filterable(filterable => filterable

        .Extra(false)

         .Operators(operators => operators

            .ForString(str => str.Clear()              

               .IsEqualTo("Es igual a")

            ))
Dimiter Madjarov
Telerik team
 answered on 10 Dec 2013
1 answer
181 views
Hello,

We have problems with the Multiselect: the initial values ​​don’t bind the control on loading of the component.
RoutesSelected a list of type "DepotViewModel" defined in the datasource.
RouteGuids is a list of Guid type.

 @(Html.Kendo().MultiSelect()                            
.Name("RouteGuids")                             
.DataTextField("Code")                             
.DataValueField("Id")                             
.Placeholder("Select route...")
.AutoBind(true)                            
.Filter("startswith")
.MaxSelectedItems(8)
.Value(Model.RoutesSelected)
.DataSource(source => source.Read(read => read.Action("GetDepots", "Request")).ServerFiltering(false)               
)      
)

Any idea?

Thanks,
Mathieu
Petur Subev
Telerik team
 answered on 10 Dec 2013
1 answer
2.3K+ views
So I have figured out how to give a grid a default sort order and it works good...  I would like to also be able to give it a secondary sort order...  first sort is "Bill Date" and then within rows that have the same bill date, they would be sort by "CoordinationOfBenefit".

Also of note, I have enabled multisort in the .Sortable

Thanks,
Jason



@(Html.Kendo().Grid<AccountClaim>()
                        .Scrollable(s => s.Height("auto"))
                        .Name("AccountClaimsGrid")
                        .HtmlAttributes(new { @class = "cursorLink", style= "height: 200px;" })
                        .DataSource(ds => ds.Ajax()
                            .Sort(sort => sort.Add("BillDate").Descending())
                            .Read("AccountClaimsData", "Workdriver", new { ProductName = ViewBag.SelectedProduct.ProductName, AccountId = Model.Account.AccountId })
                            //.PageSize(5)
                            .Events(e => e.Change("ClaimDataSourceChanged")))
                        .Columns(c =>
                        {
                            c.Bound(f => f.AccountClaimId).Visible(false);
                            c.Bound(f => f.ClaimNumber).Title("Claim Number").Width(125);
                            c.Bound(f => f.InsuranceCode).Title("Ins Code").Width(75);
                            c.Bound(f => f.CoordinationOfBenefit).Title("COB").Width(55);
                            c.Bound(f => f.ServiceDate).Title("Service").Format("{0:d}").Width(85);
                            c.Bound(f => f.BillDate).Title("Bill").Format("{0:d}").Width(85);
                            c.Bound(f => f.ClaimStatusRollupName).Title("Status").Width(100);
                            c.Bound(f => f.ClaimAmount).Title("Claim Amount").ClientTemplate("<span style='float: right;'>#=kendo.toString(ClaimAmount,'c')#</span>").Width(115);
                            c.Bound(f => f.PaidAmount).Title("Paid Amount").ClientTemplate("<span style='float: right;'>#=kendo.toString(PaidAmount,'c')#</span>").Width(110);
                            c.Bound(f => f.AdjustmentAmount).Title("Adjustment Amount").ClientTemplate("<span style='float: right;'>#=kendo.toString(AdjustmentAmount,'c')#</span>").Width(135);
                            c.Bound(f => f.PaidAmount).Title("Patient Amount").ClientTemplate("<span style='float: right;'>#=kendo.toString(PaidAmount,'c')#</span>").Width(125);
                        })
                        .Selectable(s => s.Mode(GridSelectionMode.Single))
                        .Sortable(s => s.SortMode(GridSortMode.MultipleColumn))
                        .Groupable(g =>
                        {
                            g.Messages(m =>
                            {
                                m.Empty("Drag Column Header Here to Group");
                            }
                            );
                        }
                            )
                        .Filterable()
                        .ColumnMenu()
                        .Events(e => e.Change("ClaimSelectionChanged"))
                    )
Alexander Popov
Telerik team
 answered on 09 Dec 2013
1 answer
98 views
When I try to add some table/tr/td tags, it is displaying some lines at the end of td tags.  Attaching a sample image of how it is appearing wtihin the Kendo Grid.

Sample Code :


<script id="DetailInfo" type="text/html">
<table class="DetailReport" cellspacing="10" >
<tbody>
<tr>
<td>Audit Key:</td>
<td><input Type="TextBox" width="10" class="data" ID="auditkey" readonly value="Test"/> </td>
<td><Label ID="label5">LPI Refund ID:</Label> </td>
<td><input Type="TextBox" class="data" ID="RID" readonly value="asdf"/> </td>
<td><Label ID="label12" class="label">Report Date:</Label></td>
<td><input type="TextBox" ID="ReportDate" class="data" readonly/></td>
<td><Label ID="label13" class="label">Rfund Amt:</Label> </td>
<td><input type="TextBox" ID="refundedamount" class="data" readonly /></td>

</tr>

</tbody>
</table>
</script>
THanks
Siva

Dimo
Telerik team
 answered on 09 Dec 2013
6 answers
428 views
What I'm trying to do is I have 2 ComboBoxes that are setup in a Cascading relationship.  What I am not able to get working is that when 1 option is selected in the first ComboBox the cascaded ComboBox should ONLY allow choices from the Items list it is populated with.  When a 2nd option is selected in the first ComboBox(i.e. Other) the cascaded ComboBox should allow ANY text to be entered.

How can I achieve this?  Below is my View and Controller in question. 

VIEW:
<div class="form-group">
            @Html.LabelFor(model => model.locationCode, new { @class = "control-label col-md-2" })
            <div class="col-md-10">
                @(Html.Kendo().ComboBox()
                        .Name("locationCode")
                        .Filter(FilterType.Contains)
                        .DataTextField("Text")
                        .DataValueField("Value")
                        .BindTo(Model.Locations)
                        .Suggest(true)
                )
                @Html.ValidationMessageFor(model => model.locationCode)
            </div>
        </div>
 
        <div class="form-group">
            @Html.LabelFor(model => model.loadType, new { @class = "control-label col-md-2" })
            <div class="col-md-10">
                @(Html.Kendo().ComboBox()
                        .Name("loadType")
                        .Filter(FilterType.Contains)
                        .DataTextField("Text")
                        .DataValueField("Value")
                        .BindTo(Model.LoadTypes)
                        .Suggest(true)
                )
                @Html.ValidationMessageFor(model => model.loadType)
            </div>
        </div>
 
        <div class="form-group">
            @Html.LabelFor(model => model.loadDescrip, new { @class = "control-label col-md-2" })
            <div class="col-md-10">
                @(Html.Kendo().ComboBox()
                        .Name("loadDescription")
                        .Filter(FilterType.Contains)
                        .DataTextField("DocCode")
                        .DataValueField("DocCode")
                        .DataSource(source =>
                        {
                            source.Read(read =>
                            {
                                read.Action("GetCascadeDocumentNumbers", "DockDoor")
                                    .Data("filterLoadDescription");
                            })
                          .ServerFiltering(true);
                        })
                        .Enable(false)
                        .AutoBind(false)
                        .CascadeFrom("loadType")
                )
                <script>
                    function filterLoadDescription() {
                        return {
                            locCode: $("#locationCode").val(),
                            loadType: $("#loadType").val(),
                            docNumFilter: $("#loadDescription").data("kendoComboBox").input.val()
                        };
                    }
                </script>
                @Html.ValidationMessageFor(model => model.loadDescrip)
            </div>
        </div>
CONTROLLER:
public JsonResult GetCascadeDocumentNumbers(string locCode, string loadType, string docNumFilter)
{
    if (loadType != "OPEN" && loadType != "GENERIC")
    {
        var docNums = db.GetCurrentDocumentNumbers(locCode, loadType).AsEnumerable();
 
        if (!string.IsNullOrWhiteSpace(docNumFilter))
        {
            docNums = docNums.Where(x => x.Contains(docNumFilter));
        }
 
        return Json(docNums.Select(x => new { DocCode = x.ToString() }), JsonRequestBehavior.AllowGet);
    }
    return Json(string.Empty, JsonRequestBehavior.AllowGet);
}


Georgi Krustev
Telerik team
 answered on 09 Dec 2013
1 answer
223 views
I see the documentation using Kendo UI web, etc...   I want to use the wrappers for this instead of coding the jscript.

Any resources?
Alexander Popov
Telerik team
 answered on 09 Dec 2013
1 answer
106 views
Hello,

I use the ListView with the selectable option set to ListViewSelectionMode.Single via MVC Wrapper.
Clicking on an item and therefore changing selection doesn't fire the change event if I move the mouse (within list item borders) while clicking.

I think this behaviour can be reproduced by setting selectable option to ListViewSelectionMode.Single at this demo.
 Just click the text and move mouse pointer to hilight the text. The change event si not fired.

The event is always fired as soon as you set selection mode to ListViewSelectionMode.Multiple.

Is this a bug?
Is there a workaround (can't use multiple select)?

Thanks in advance
Dirk




Dimiter Madjarov
Telerik team
 answered on 06 Dec 2013
1 answer
110 views
Hi there,

Trying to make use of the wrappers to speed things up, but I cant find a way to add "required" to a field, since the modelbinding doesn't care about the [Required] attribute on the property.
public class TaskItem : ISchedulerEvent
{
    [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
    public int TaskItemID { get; set; }
    [Required]
    public string Title { get; set; }
    public string Description { get; set; }
    [Required]
    public DateTime Start { get; set; }
    public string StartTimezone { get; set; }
    [Required]
    public DateTime End { get; set; }
    public string EndTimezone { get; set; }
    public string RecurrenceRule { get; set; }
    public int? RecurrenceID { get; set; }
    public string RecurrenceException { get; set; }
    public bool IsAllDay { get; set; }
    public int? OwnerID { get; set; }
}
In javascript this seems easy:
schema: {
    model: {
        id: "taskID",
        fields: {
            taskID: { from: "TaskID", type: "number" },
            title: { from: "Title", validation: { required: true } }
        }
    }
}
Also, I read that servervalidation were supposed to be implemented in q3-release, but I can't get it to work.

Regards,
Pär Sandgren
Vladimir Iliev
Telerik team
 answered on 06 Dec 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?