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

Hi,

Is it possible to set conditional formatting for one cell, depending from another cell value? I mean something like this:

[A1>100][GREEN]#,##0;[A1<=-100][YELLOW]#,##0;[CYAN]#,##0

Veselin Tsvetanov
Telerik team
 answered on 15 Aug 2017
1 answer
281 views
I want to set the default color for the Kendo Editor's tool to "black". By default, the color is always "white".
Ivan Danchev
Telerik team
 answered on 14 Aug 2017
1 answer
210 views

Hi,

I have a scenario where an API I'm using is only able to filter by one column at a time. So either name, or email, or phone number, stuff like that. 

How can I prevent multiple filters being set at the same time?

 

I tried binding a mousedown handler to the filter button in the filter menu and iterating over the existing filters to set them to an empty string. Something like this, which I found here on the forums:

1.$(".k-filter-menu").find("button[type='submit']").on("mousedown", function() {
2.    var dataSource = $("#myGrid").data("kendoGrid").dataSource;
3.    for (var i = 0; i < dataSource.options.fields.length - 1; i++) {
4.         dataSource.filter({ field: dataSource.options.fields[i].field, value: "" });
5.    }
6.    dataSource.filter([]);
7.});

 

This triggered several ajax calls though with filters like "Name~undefined~''".

Is there a better way to handle this scenario?

 

Kind regards,

Georg

Stefan
Telerik team
 answered on 14 Aug 2017
1 answer
173 views

I'm using the menu component, and in the resulting links in my page it is adding a query string parameter or Length=3, to all of them.. What is this, and how do I get rid of it?

<div id="mySidenav" class="sidenav">
               <a href="javascript:void(0)" class="closebtn" onclick="closeNav()">×</a>
               <div id="sideNavLinks" style="width: 85%">
                   @(Html.Kendo().Menu()
                       .Name("mainMenu")
                       .Orientation(MenuOrientation.Vertical)
                       .Items(i =>
                       {
                           i.Add().Text("Home").Action("Home", "Map");
                           i.Add().Text("GENERAL MAPS").Items(c =>
                           {
                               c.Add().Text("SUTA Map").Action("Suta", "Map");
                           });
                           i.Add().Text("COMPLIANCE MAPS").Items(c =>
                           {
                               c.Add().Text("General License & Registration").Action("LicenseRegistration", "Map");
                               c.Add().Text("Financial & Bonding Requirements").Action("FinancialBonding", "Map");
                           });
                       })
                   )  
               </div>
           </div>

 

But here is what the resulting HTML looks like:

<div style="padding-left: 25px;">
    <span style="font-size: 20px; font-weight: bolder; color: #f68831">General Maps</span>
    <br />
 
    <div style="padding-left: 25px">
        <a class="main" href="/Vensure.MappingV2/Map/SUTA?Length=3">SUTA Map</a> - Various Data Points relating to the State Unemployment Tax Act, otherwise known as SUTA
    </div>
 
    <p></p>
 
    <span style="font-size: 20px; font-weight: bolder; color: #f68831">Compliance Maps</span>
    <br />
 
    <div style="padding-left: 25px">
        <a class="main" href="/Vensure.MappingV2/Map/LicenseRegistration?Length=3">Licensing & Registration</a> - Various Data Points relating to Licensing and Registration
    </div>
 
    <div style="padding-left: 25px">
        <a class="main" href="/Vensure.MappingV2/Map/FinancialBonding?Length=3">Financial & Bonding Requirements</a> - Various Data Points relating to Financial & Bonding Requirements
    </div>
</div>

 

Where is this parameter coming from, and how do I get rid of it?

Joe
Top achievements
Rank 1
 answered on 11 Aug 2017
1 answer
683 views

I have applied the Drag and Drop feature my Grid, It is not working for left 2 columns in Chrome and left 3 columns in Edge means when i drag the row by choosing from  left 2 columns or some times left 3 columns and  try to drop it on other position of row, it will stop working. Here is my code:

<div id="example">

<div id="grid"></div>

</div>

<script>
$(document).ready(function () {

var data = [{
EID: 1,
MilestoneName: "Chai",
MilestoneStart: "",
MilestoneNCD: "",
MilestoneComplete: "",
UnitPrice: 18.0000,
UnitsInStock: 39,
Discontinued: false,
PercComplete: "",
WorkPackagesOpen: "",
PlanTasksCount: "",
Position: 1
}, {
EID: 2,
MilestoneName: "Chang",
MilestoneStart: "",
MilestoneNCD: "",
MilestoneComplete: "",
UnitPrice: 19.0000,
UnitsInStock: 17,
Discontinued: false,
PercComplete: "",
WorkPackagesOpen: "",
PlanTasksCount: "",
Position: 2
}, {
EID: 3,
MilestoneName: "Aniseed Syrup",
MilestoneStart: "",
MilestoneNCD: "",
MilestoneComplete: "",
UnitPrice: 10.0000,
UnitsInStock: 13,
Discontinued: false,
PercComplete: "",
WorkPackagesOpen: "",
PlanTasksCount: "",
Position: 3
}, {
EID: 4,
MilestoneName: "Chef Anton's Cajun Seasoning",
MilestoneStart: "",
MilestoneNCD: "",
MilestoneComplete: "",
UnitPrice: 22.0000,
UnitsInStock: 53,
Discontinued: false,
PercComplete: "",
WorkPackagesOpen: "",
PlanTasksCount: "",
Position: 4
}, {
EID: 5,
MilestoneName: "Chef Anton's Gumbo Mix",
MilestoneStart: "",
MilestoneNCD: "",
MilestoneComplete:"",
UnitPrice: 21.3500,
UnitsInStock: 0,
Discontinued: true,
PercComplete: "",
WorkPackagesOpen: "",
PlanTasksCount: "",
Position: 5
}];

var data = data;
var dataSource = new kendo.data.DataSource({
data: data,
schema: {
model: {
id: "EID",
fields: {
EID: { type: "number" },
MilestoneName: { type: "string" },
MilestoneStart: { type: "date" },
MilestoneNCD: { type: "date" },
MilestoneRNCD: { type: "date" },
MilestoneComplete: { type: "date" },
MilestoneResp: { type: "string" },
MilestoneDelay: { type: "string" },
PlanTasksCount: { type: "string" },
WorkPackagesOpen: { type: "string" },
PercComplete: { type: "string" },
Position: { type: "number" }
}
}
}
});

var grid = $("#grid").kendoGrid({
dataSource: dataSource,
scrollable: false,
selectable: "single row",
dataBound: onDataBound,
columns: [
{ field: "EID", title: "EID", width: "50px", },
{ field: "MilestoneName", title: "Milestones", width: "320px" },
{ field: "MilestoneStart", title: "Start Date", format: "{0:MM/dd/yyyy}", width: "90px" },
{ field: "MilestoneNCD", title: "NCD", format: "{0:MM/dd/yyyy}", width: "90px" },
{ field: "MilestoneRNCD", title: "RNCD", format: "{0:MM/dd/yyyy}", width: "90px" },
{ field: "MilestoneComplete", title: "Complete Date", format: "{0:MM/dd/yyyy}", width: "90px" },
{ field: "MilestoneResp", title: "Milestone Resp", width: "150px"},
{ field: "MilestoneDelay", title: "Milestone Delay", width: "150px" },
{ field: "WorkPackagesOpen", title: "Milestone Delay", width: "150px" },
{ field: "PercComplete", title: "Milestone Delay", width: "150px"},
{ field: "Position", title: "Position", width: "30px" },
]
}).data("kendoGrid");

grid.table.kendoDraggable({
filter: "tbody > tr",
group: "gridGroup",
hint: function (e) {
return $('<div id="DragRow" class="k-grid k-widget"><table><tbody><tr>' + e.html() + '</tr></tbody></table></div>');
},
drag: function (e) {
var grid = $("#grid").data("kendoGrid"),
dataSource = grid.dataSource;
var guid = grid.table.find("tr data-uid");
var target = dataSource.getByUid($(e.currentTarget).data("uid"));
if (target.MilestoneRow <= 5 || target.MilestoneRow >= 100) {
$("#DragRow").html('');
return;
}
}

});

grid.table/*.find("tbody > tr")*/.kendoDropTarget({
group: "gridGroup",
drop: function (e) {
var grid = $(e.sender.element).closest('.k-grid').getKendoGrid(),
dataSource = grid.dataSource;
target = dataSource.getByUid($(e.draggable.currentTarget).data("uid")),
dest = $(e.target);

if (dest.is("th")) {
return;
}
dest = dataSource.getByUid(dest.parent().data("uid"));

if (target == undefined || dest == undefined) {
return false;
}

if (target.MilestoneRow <= 5 || target.MilestoneRow >= 100 || dest.MilestoneRow <= 5 || dest.MilestoneRow >= 100) {
return;
}

//not on same item
if (target.get("uid") !== dest.get("uid")) {

//reorder the items
var tmp = target.get("Position");
target.set("Position", dest.get("Position"));
dest.set("Position", tmp);


dataSource.sort({ field: "Position", dir: "asc" });

}
}
});

    });

    function onDataBound(e) {
        var grid = $("#grid").data("kendoGrid");
        var gridData = grid.dataSource.view();
        $("#grid tr.k-alt").removeClass("k-alt");

        for (var i = 0; i < gridData.length; i++) {
            if (gridData[i].MilestoneRow <= 5 || gridData[i].MilestoneRow >= 100) {
                grid.table.find("tr[data-uid='" + gridData[i].uid + "']").addClass("backgroundColor");
            }
        }
    }

    function getSelectedMilestone() {
        var grid = $("#grid").data("kendoGrid");
        return grid.dataItem(grid.select());
}

</script>

Georgi
Telerik team
 answered on 11 Aug 2017
1 answer
149 views
With versions of Bing maps being deprecated < 8.0, can you confirm the version that is used by the map control in the latest R2 2017 SP1 control?
Stefan
Telerik team
 answered on 11 Aug 2017
8 answers
845 views
I know we can send additional data to the read event, but is there a mechanism for sending additional data to the popup edit screen?
Georgi
Telerik team
 answered on 11 Aug 2017
3 answers
255 views

 

Hi,
Trying to build a multicolumn form within a tabstrip using div and bootstrap grid tags. Even after reading article about Bootstrap and Kendo, (http://docs.telerik.com/kendo-ui/third-party/using-kendo-with-twitter-bootstrap#nesting-kendo-ui-widgets-and-bootstrap-grid-layout), the layout seems not to work as expected like in:

01.<div class="row">
02.    <div class="col-sm-6 col-md-6">
03.        <div class="form-group">
04.            Name
05.            @(Html.Kendo().TextBoxFor(m => m.Nome).HtmlAttributes(new { @class = "k-textbox" }))
06.        </div>
07.        <div class="form-group">
08.            Last Change
09.            @(Html.Kendo().TextBoxFor(m => m.ModifiedOn).HtmlAttributes(new { @class = "k-textbox" }))
10.        </div>
11.    </div>
12.    <div class="col-sm-6 col-md-6">
13.        <div class="form-group">
14.            Status
15.            @(Html.Kendo().TextBoxFor(m => m.Status).HtmlAttributes(new { @class = "k-textbox" }))
16.        </div>
17.        <div class="form-group">
18.            Workflow
19.            @(Html.Kendo().TextBoxFor(m => m.WorkflowStatus).HtmlAttributes(new { @class = "k-textbox" }))
20.        </div>
21.    </div>
22.</div>

 

The expected result would be a form with two columns and fields (2x) on both sides. The code is in a partial view and it is invoked on the tabstrip as follows:

01.@using (Html.BeginForm())
02.{
03.    @Html.AntiForgeryToken()
04.     
05.    @(Html.Kendo().TabStrip()
06.    .Name("customerRecord")
07.    .Items(tab =>
08.    {
09.        tab.Add().Text("Personal Data")
10.        .Selected(true)
11.        .Content(m => Html.Partial("_PersonalData", m));
12.    })
13.    )
14.}

 

Is this the way to have it done or not?

Regards,

Marcello

 

 

Dimitar
Telerik team
 answered on 10 Aug 2017
3 answers
326 views

Hi,

I have a requirement to have a TreeList which has up to 4 levels. I have the filter option enabled which gives me a filter to say Contains '' for example. When the first loads it loads with all nodes closed. When I apply the filter it only filters on what is shown directly in the view, so in this case on the top level items. Is there a way that it can filter on any child node as well, such that if a level 4 child node contained '' for example it would show the item expanded with the various parent nodes?

I can set it so that the view is always expanded, but then each time the view is rebound any user alterations to the expanded state are  by the expansion. 

Thanks,

Neil

Stefan
Telerik team
 answered on 10 Aug 2017
3 answers
81 views

Hello,

I have a requirement to filter some prices using pre-defined values like the following:

  • Less than £10
  • Between £10 and £20
  • Between £20 and £30
  • More than £30

I can't seem to see a way to do this with the Grid. Is it possible?

Thank you

Lucy

Viktor Tachev
Telerik team
 answered on 09 Aug 2017
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
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
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?