Hello,
I have a weird problem. I want to start using the multicolumncombobox. But when I have multicolumncombobox and kendogrid on one page, calling data("kendoGrid") on the grid DIV will return undefined. If i remove the multicombo, it returns object of the kendogrid. This is a simplified situation, in our project I get errors from kendo JS library, when I need to open a dialog with kendogrid or when I use maskedtextbox. Because both need to reference some object using jQuery data() function. Am I doing something wrong?
This is my test code, button returns kendogrid object, but only with multicombo commented out:
using
System;
using
System.Configuration;
using
System.Web;
using
Telerik.Web.UI;
public
partial
class
TEST1 : System.Web.UI.Page
{
protected
void
Page_Init(
object
sender, EventArgs e)
{
System.Web.UI.Page currentPage = (System.Web.UI.Page)HttpContext.Current.CurrentHandler;
RadScriptManager RadScriptManager = (RadScriptManager)currentPage.FindControl(
"RadScriptManagerMain"
);
RadScriptManager.Scripts.Add(
new
System.Web.UI.ScriptReference((String.Format(
"~/js/jquery.min.js?{0}"
, ConfigurationManager.AppSettings[
"Application_Version"
]))));
RadScriptManager.Scripts.Add(
new
System.Web.UI.ScriptReference((String.Format(
"~/js/jszip.min.js?{0}"
, ConfigurationManager.AppSettings[
"Application_Version"
]))));
RadScriptManager.Scripts.Add(
new
System.Web.UI.ScriptReference((String.Format(
"~/js/kendo.all.min.js?{0}"
, ConfigurationManager.AppSettings[
"Application_Version"
]))));
}
}
<%@ Page Title="TEST1" Language="C#" AutoEventWireup="true"
CodeFile="TEST1.aspx.cs" Inherits="TEST1" %>
<!DOCTYPE html>
<
html
>
<
head
runat
=
"server"
>
<
title
>TEST1</
title
>
</
head
>
<
body
>
<
telerik:RadScriptManager
runat
=
"server"
EnableScriptCombine
=
"false"
ID
=
"RadScriptManagerMain"
LoadScriptsBeforeUI
=
"true"
OutputCompression
=
"AutoDetect"
AsyncPostBackTimeout
=
"36000"
ScriptMode
=
"Release"
>
</
telerik:RadScriptManager
>
<
div
id
=
"multicombo"
>
<
telerik:RadMultiColumnComboBox
ID
=
"RadMultiColumnComboBox1"
runat
=
"server"
GroupByField
=
"Country"
Filter
=
"Contains"
DropDownWidth
=
"500"
Height
=
"400"
Width
=
"100%"
Placeholder
=
"select from the dropdown or type"
DataTextField
=
"ContactName"
DataValueField
=
"CustomerID"
MinLength
=
"3"
EnforceMinLength
=
"false"
>
<
WebServiceSettings
Select-ContentType
=
"JSON"
ServiceType
=
"OData"
</
WebServiceSettings
>
<
ColumnsCollection
>
<
telerik:MultiColumnComboBoxColumn
Field
=
"CustomerID"
Title
=
"ID"
/>
<
telerik:MultiColumnComboBoxColumn
Field
=
"ContactName"
Title
=
"Name"
/>
</
ColumnsCollection
>
</
telerik:RadMultiColumnComboBox
>
</
div
>
<
br
/>
<
div
id
=
"kendogrid"
></
div
>
<
br
/>
<
button
onclick
=
"getdata()"
>Call data("kendoGrid) on grid</
button
>
<
script
>
$(document).ready(function () {
$("#kendogrid").kendoGrid({
columns: [{
field: "FirstName",
title: "First Name"
},
{
field: "LastName",
title: "Last Name"
}],
dataSource: {
data: [{
FirstName: "Joe",
LastName: "Smith"
},
{
FirstName: "Jane",
LastName: "Smith"
}]
}
});
});
function getdata() {
alert($("#kendogrid").data("kendoGrid"));
}
</
script
>
</
body
>
</
html
>