我有follow方法返回一个表示IEnumerable<'a>
('a =匿名类型)的动态对象:
public dynamic GetReportFilesbyStoreProductID(int StoreProductID)
{
Report report = this.repository.GetReportByStoreProductID(StoreProductID);
if (report == null || report.ReportFiles == null)
{
return null;
}
var query = from x in report.ReportFiles
orderby x.DisplayOrder
select new { ID = x.RptFileID, Description = x.LinkDescription, File = x.LinkPath, GroupDescription = x.ReportFileGroup.Description };
return query;
}
Run Code Online (Sandbox Code Playgroud)
我希望能够访问Count
此IEnumerable
匿名类型的属性.我正在尝试使用以下代码访问上述方法,但它失败了:
dynamic Segments = Top20Controller.GetReportFilesbyStoreProductID(StoreProductID");
if (Segments.Count == 0) // <== Fails because object doesn't contain count.
{
...
}
Run Code Online (Sandbox Code Playgroud)
dynamic
关键字如何运作?我正在使用KendoUI KendoGrid.我有一个带删除按钮或"销毁"操作的列.Kendo会显示一个警告框,其中包含"您确定要删除此记录吗?" 我需要这个文本更具体地说明我的情况.你如何自定义这个文本?
任何帮助,将不胜感激.
我添加列的代码是:
$reports.kendoGrid(
{
dataSource: dataSource,
pageable: {
refresh: true,
pageSizes: true
},
toolbar: [{ name: "create", text: "Add" }],
columns:
[
{ field: 'name', title: 'Report', sortable: true },
{ command: ["edit", "destroy"], title: " ", width: "180px", }
],
editable: "inline",
selectable: true,
Run Code Online (Sandbox Code Playgroud) 我正在使用KendoGrid并进行内联批量编辑.只有少数几列可以编辑.当按Tab键时,下一列被选中,但它不是下一个可编辑列.有没有办法控制KendoGrid中的Tab键顺序?如何使标签跳过不可编辑的列?
我的标记:
<div id="employeeGoalsGrid"></div>
Run Code Online (Sandbox Code Playgroud)
我的Javascript:
var goalsDataSource = new kendo.data.DataSource({
transport: {
read: {
url: '/MVC/ResearcherPoints/GetEmployeeResearchers',
type: 'POST',
contentType: 'application/json'
},
update: {
url: '/MVC/ResearcherPoints/UpdateEmployeeGoal',
type: 'POST',
contentType: 'application/json'
//dataType: "jsonp"
},
parameterMap: function (options, type) {
debugger;
$.extend(options, { ID: options.id });
return JSON.stringify(options);
}
},
batch: false,
schema: {
model: {
id: 'ID',
fields: {
id: { editable: false, nullable: false },
FirstName: { editable: false, nullable: true },
LastName: { editable: false, nullable: true },
Title: { …
Run Code Online (Sandbox Code Playgroud) 我正在用KendoUI取代我的dot net charting.我正在显示分数分布图表.我希望所有的条形图都是相同的颜色,除了具有中位数分数和图例的条形图.如何为单个条纹着色独特的颜色?我如何为传奇这种新颜色着色?
下面是我的旧dotnet图表条形图,下面是我正在尝试用它取代它的新KendoUI图表.我只需要正确地着色,我们就会开展业务.任何帮助表示赞赏.
我正在使用Kendo Grid我添加了"创建"来进行内联添加记录.如何更改添加按钮上的措辞?目前它写道:"添加一个新的记录"我想简化它只读"添加",我也想保持相同的图标.
我的代码看起来像:
$reports.kendoGrid(
{
dataSource: dataSource,
toolbar: ["create"],
...
Run Code Online (Sandbox Code Playgroud)
任何建议将不胜感激.
我正在使用Kendo Multi Select.我想将选定的值加载到多选中.如何在Java Script中设置数据值?我有以下脚本:
$('#selectedFilters').kendoMultiSelect({
dataSource: data,
dataTextField: 'name',
dataValueField: 'value',
filter: 'contains',
placeholder: "Add Filter",
delay: 0,
minLength: 2,
highlightFirst: true,
ignoreCase: true,
change: function (event) {
applyFilters();
},
});
Run Code Online (Sandbox Code Playgroud) 我正在使用KendoUi滑块.我正在使用以下设置:
jQuery(document).ready(function () {
jQuery("#slider").kendoSlider({
increaseButtonTitle: "Right",
decreaseButtonTitle: "Left",
showButtons: false,
min: 1,
max: 4,
smallStep: .2,
largeStep: 1,
value: <%= TotalScore %>,
tooltip:
{
enabled:false
}
});
Run Code Online (Sandbox Code Playgroud)
我有四个大步骤,我想标记每个"P""O""G""I"代替数字.我怎样才能做到这一点?
试图将Bullet图表设计为与营销愿望完全一致.所需的Graph看起来像:
如何在条形图的顶部添加标签?
我试过设置Kendo文档中的labels属性:
labels:
{
visible: true,
format: "{0}",
font: "14px Arial",
},
Run Code Online (Sandbox Code Playgroud)
这是我的脚本不起作用:
$barChart = $("#bar-chart").empty();
$barChart.kendoChart({
theme: global.app.chartsTheme,
renderAs: "svg",
legend: {
position: "bottom"
},
seriesDefaults: {
type: "column"
},
series: [
{
type: "verticalBullet",
currentField: "score",
targetField: "average",
target: {
color: "#444",
dashType: "dot",
line: {
width: 1,
}
},
labels:
{
visible: true,
format: "{0}",
font: "14px Arial",
},
data: [
{
score: 93.7,
average: 65.2,
}, {
score: 80.2,
average: 22.2,
}, {
score: 60.8, …
Run Code Online (Sandbox Code Playgroud) 我正在使用Telerik Kendo饼图,我希望能够为楔子上色.
以下是我的Kendo UI饼图的标记:
<script type="text/javascript">
function createChart() {
jQuery("#chart").kendoChart({
theme: jQuery(document).data("kendoSkin") || "Metro",
legend: {
position: "bottom"
},
seriesDefaults: {
labels: {
visible: true,
format: "{0}%"
}
},
series: [{
type: "pie",
data: [{
category: "Remaining Work",
value: 75,
explode: true
}, {
category: "CIOs",
value: 2
}, {
category: "Other Executives",
value: 10
}, {
category: "Directors and Physicians",
value: 13
}]
}],
tooltip: {
visible: true,
format: "{0}%"
}
});
}
jQuery(document).ready(function () {
setTimeout(function () { …
Run Code Online (Sandbox Code Playgroud) 我正在使用Kendo UI来替换现有的图表.我需要尽量减少图表之间的变化.有谁知道如何使折线图上的点固体?是否可以使线条更薄?
这是我的图表图片:
这是我的jsFiddle项目,如果你想玩它:http://jsfiddle.net/rodneyhickman/uMTnh/2/
我的HTML看起来像:
<div id='chart' ></div>
Run Code Online (Sandbox Code Playgroud)
我的jQuery脚本看起来像:
jQuery('#chart').kendoChart({
title: {
text: "Overall Score out of 100",
align: "left",
font: "18px Arial, Verdana, sans-serif",
color: "#444"
},
seriesDefaults: {
type: "line",
missingValues: "interpolate",
},
legend: {
position: "bottom"
},
tooltip: {
visible: true,
format: "{0}%"
},
valueAxis: {
min: 70,
max: 85,
plotBands: [{
from: 70,
to: 75,
color: "#EDF5FF"},
{
from: 80,
to: 85,
color: "#EDF5FF"}]
},
series: [{
name: "Some Product",
color: "004990",
tooltip: …
Run Code Online (Sandbox Code Playgroud) kendo-ui ×9
javascript ×7
jquery ×6
telerik ×6
c# ×4
asp.net ×2
grid ×2
.net ×1
asp.net-mvc ×1
bullet-chart ×1
c#-4.0 ×1
dynamic ×1
kendo-mobile ×1
reflection ×1