I have been researching the topic and had little success on solving the problem. Here is a sample of my code thus far.
View
@(Html.Telerik().Grid<
ProductModel.ProductCommentsModel
>()
.Name("productcomments-grid")
.DataKeys(keys =>
{
keys.Add(x => x.Id);
})
.DataBinding(dataBinding =>
{
dataBinding.Ajax()
.Select("ProductCommentsList", "Product", new { productId = Model.Id })
.Update("ProductCommentUpdate", "Product")
.Delete("ProductCommentDelete", "Product");
})
.Columns(columns =>
{
columns.Bound(x => x.Id)
.Hidden(true);
columns.Bound(x => x.ProductId)
.Hidden(true);
columns.Bound(x => x.CustomerId)
.Hidden(true);
columns.Bound(x => x.CustomerName)
.Width(200)
.ReadOnly(true);
columns.Bound(x => x.CreatedDate)
.Width(100)
.ReadOnly(true);
columns.Bound(x => x.LastModifiedDate)
.Width(100)
.ReadOnly(true);
columns.Bound(x => x.Comment);
columns.Command(commands =>
{
commands.Edit().ButtonType(GridButtonType.Text);
commands.Delete().ButtonType(GridButtonType.Text);
});
})
.Editable(edit => edit.Mode(GridEditMode.PopUp))
.EnableCustomBinding(true))
public
partial
class
ProductCommentsModel : BaseNopEntityModel
{
public
int
ProductId {
get
;
set
; }
public
int
CustomerId {
get
;
set
; }
public
string
CustomerName {
get
;
set
; }
[Required(AllowEmptyStrings=
true
)]
[DisplayFormat(NullDisplayText =
""
, DataFormatString =
"0:MM/dd/yyyy"
)]
public
DateTime? CreatedDate {
get
;
set
; }
[Required(AllowEmptyStrings =
true
)]
[DisplayFormat(NullDisplayText =
""
, DataFormatString =
"0:MM/dd/yyyy"
)]
public
DateTime? LastModifiedDate {
get
;
set
; }
public
DateTime? SentForRepair {
get
;
set
; }
public
string
Comment {
get
;
set
; }
}
function
loadTwitterFeed() {
var
dataSource =
new
kendo.data.DataSource({
transport: {
read: {
url:
"http://api.twitter.com/1/statuses/user_timeline.json"
, // the remove service url
dataType:
"jsonp"
// JSONP (JSON with padding) is required for cross-domain AJAX
},
parameterMap:
function
(options) {
return
{
screen_name:
"USER_NAME"
,
count: 10,
since_id: options.since_id,
//additional parameters sent to the remote service
max_id: options.max_id
//additional parameters sent to the remove service
};
}
}
});
$(
"#twitter-feed"
).kendoMobileListView({
dataSource: dataSource,
template: $(
"#twitter-template"
).text(),
appendOnRefresh:
true
,
pullToRefresh:
true
,
//addition parameters which will be passed to the DataSource's read method
pullParameters:
function
(item) {
//pass first data item of the ListView
return
{
since_id: item.id_str
};
},
endlessScroll:
true
,
//addition parameters which will be passed to the DataSource's next method
endlessScrollParameters:
function
(firstOrigin) {
if
(firstOrigin) {
return
{
max_id: firstOrigin.id_str
};
}
}
});
}
$( "#grdTrading" ).kendoGrid( {
dataSource: grddataSource, // static data source
scrollable: true,
height: 180,
columns: [
"Code", "Level",
{
field: "Flag",
template: "#=Flag.Name#",
width: "150px",
editor: TradingDropDownEditor
}
],
editable: true,
sortable: true,
selectable: true
} );
function TradingDropDownEditor( container, options )
{
$( '<input data-text-field="Name" data-value-field="FlagID" id="Category" data-bind="value:' + options.field + '"/>' ).appendTo( container ).kendoDropDownList( {
autoBind: false,
change: function ( e )
{
var grid = $( "#grdTrading" ).data( "kendoGrid" );
var dataItem = null;
grid.select().each( function ( e )
{
dataItem = grid.dataItem( $( this ) );
var id = dataItem.Code;
var DropdownText = dataItem.Flag.Name;
alert( DropdownText );
if ( id == "ABC" && DropdownText == "No" )
{
//Adding dropdown to the second grid
AssociatedData = [{ text: "No", value: "No"}];
$( "#grdAssociated" ).find( "#ddlAssoPort" ).kendoDropDownList( {
dataTextField: "text",
dataValueField: "value",
autoBind: true,
enable: false,
dataSource: AssociatedData
} );
}
else
{
return;
}
} );
},
dataSource: ddlFlag
} );
}
I am able to add the dropdown but on change event if I select the dropdown it vanishes the the dropdown in the other grid.
Please look at the code and please help..!
Hi,
I am using the kendo grid with custom popup edit template and everything works fine until i use text area inside the template.
any html after the textare does not show in the edit popup template and
hence i cannot see the update and cancel buttons or any other field that
i declare after the textarea
Hi there, for some reason I can't force bubble chart to show legend, at the same time I'm able to see category name in the tooltip, could you please explain why, thanks.
$("#Chart1").kendoChart({
title: {
text: "Chart"
},
legend: {
visible: true,
position: "bottom"
},
dataSource: @{@Html.Raw(id)}ChartDataSource1,
seriesDefaults: {
type: "bubble"
},
seriesColors: ["#004D5C", "#FF8700", "#38A660", "#E5D843", "#80BF34"],
series:
[{
type: "bubble",
categoryField: "Field1",
xField: "Field2",
yField: "Field3",
sizeField: "Size",
colorField: "Color",
maxSize: 35,
minSize: 3,
visibleInLegendField: "true",
tooltip: {
visible: true,
format: "{2} {3}"
}
}
]
,
xAxis: {
//max: 1000,
labels: {
format: "{0}"
}
},
yAxis: {
//min: 80,
labels: {
format: "{0}"
}
},
});