<
telerik:RadComboBox
ID
=
"rcb_1"
AllowCustomText
=
"true"
runat
=
"server"
EmptyMessage
=
"Please select a value..."
DataTextField
=
"description"
DataValueField
=
"ID"
CssClass
=
"radComboBox"
AutoPostBack
=
"true"
MaxHeight
=
"200px"
width
=
"170px"
EnableAutomaticLoadOnDemand
=
"true"
Filter
=
"Contains"
></
telerik:RadComboBox
>
rcb_1.DataSource =
Class
.getData()
rcb_1.DataBind()
<
telerik:RadGrid
ID
=
"RGrid1"
runat
=
"server"
AutoGenerateColumns
=
"False"
DataSourceID
=
"SQLDS"
GridLines
=
"None"
DataMember
=
"DefaultView"
AutoGenerateDeleteColumn
=
"True"
AutoGenerateEditColumn
=
"True"
AllowAutomaticDeletes
=
"True"
AllowAutomaticUpdates
=
"True"
>
<
MasterTableView
DataSourceID
=
"SQLDS"
DataKeyNames
=
"ID"
>
<
CommandItemSettings
ExportToPdfText
=
"Export to Pdf"
></
CommandItemSettings
>
<
Columns
>
<
telerik:GridBoundColumn
DataField
=
"ID"
HeaderText
=
"ID"
SortExpression
=
"ID"
UniqueName
=
"ID"
Visible
=
"false"
AllowFiltering
=
"False"
AllowSorting
=
"False"
Display
=
"False"
ReadOnly
=
"True"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"NAME"
HeaderText
=
"NAME"
SortExpression
=
"NAME"
UniqueName
=
"NAME"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"ADDRESS"
HeaderText
=
"ADDRESS"
SortExpression
=
"ADDRESS"
UniqueName
=
"ADDRESS"
>
</
telerik:GridBoundColumn
>
</
Columns
>
</
MasterTableView
>
</
telerik:RadGrid
>
<
br
/>
<
br
/>
<
asp:SqlDataSource
ID
=
"SQLDS"
runat
=
"server"
ConnectionString="<%$ ConnectionStrings:ConnectionStringSQL %>"
ProviderName="<%$ ConnectionStrings:ConnectionStringSQL.ProviderName %>" SelectCommand="SELECT [ID], [NAME], [ADDRESS] FROM [Info]"
UpdateCommand="UPDATE [Info] set [NAME]=?,[ADDRESS]=? where [ID]=?"
DeleteCommand="delete from Info where [ID]=?">
<
DeleteParameters
>
<
asp:Parameter
Name
=
"ID"
Type
=
"String"
/>
</
DeleteParameters
>
<
UpdateParameters
>
<
asp:Parameter
Name
=
"NAME"
Type
=
"String"
/>
<
asp:Parameter
Name
=
"ADDRESS"
Type
=
"String"
/>
<
asp:Parameter
Name
=
"ID"
Type
=
"String"
/>
</
UpdateParameters
>
</
asp:SqlDataSource
>
I have RadComboBox on my page for multiple item selection.
its working fine.
but when i go to page 1st time..it will open tht radcombobox automatically.
After cliking on another button also it automatically open.
i want to supress tht on clik on any other control , it should open when user click on that RadComboBox
can any onw help??
my code is as followes
<
telerik:RadComboBox ID="rdCombIssueTypeID" runat="server" HighlightTemplatedItems="True" AllowCustomText="True" Width="190px" TabIndex="0" OpenDropDownOnLoad="true" OnClientSelectedIndexChanging="OnClientSelectedIndexChanging"
CloseDropDownOnBlur="true"
OnClientDropDownOpening="OnClientDropDownOpening"
OnClientDropDownClosing="OnClientDropDownClosing"
OnClientBlur="OnClientBlur">
<HeaderTemplate>
<table cellspacing="0" cellpadding="0" border="0">
<tr>
<td>
<asp:CheckBox runat="server" ID="chkAll" Enabled="true" onclick="onchkStatusAllClick(this)" />
</td>
<td style="width: 100px;"> All</td>
</tr>
</table>
</HeaderTemplate>
<ItemTemplate>
<div onclick="StopPropagation(event)">
<asp:CheckBox runat="server" ID="chk1" onclick="onCheckBoxClickRadCboCourseStatus(this)" />
<asp:Label runat="server" ID="Label1" AssociatedControlID="chk1">
<%
# Eval("IssueType")%>
</asp:Label>
</div>
</ItemTemplate>
</telerik:RadComboBox>
<script type="text/javascript" language="javascript">
function onchkStatusAllClick(parentChk) {
var combo = $find("<%= rdCombIssueTypeID.ClientID %>");;
var items = combo.get_items();
var text = "";
var values = "";
//enumerate all items
for (var i = 0; i < items.get_count(); i++) {
var item = items.getItem(i);
//get the checkbox element of the current item
var chk1 = $get(combo.get_id() + "_i" + i + "_chk1");
if (parentChk.checked) {
chk1.checked = true;
text += item.get_text() + ",";
values += item.get_value() + ",";
}
else {
chk1.checked = false;
}
}
text = removeLastComma(text);
values = removeLastComma(values);
if (parentChk.checked) {
combo.set_text("All Selected");
}
else {
combo.set_text("");
}
}
function onCheckBoxClickRadCboCourseStatus(chk) {
var combo = $find("<%= rdCombIssueTypeID.ClientID %>");
//holds the text of all checked items
var text = "";
//holds the values of all checked items
var values = "";
//get the collection of all items
var items = combo.get_items();
//enumerate all items
var count = 0;
for (var i = 0; i < items.get_count(); i++) {
var item = items.getItem(i);
//get the checkbox element of the current item
var chk1 = $get(combo.get_id() + "_i" + i + "_chk1");
if (chk1.checked) {
text += item.get_text() + ",";
values += item.get_value() + ",";
count += 1;
}
}
if (count == 1) {
text = removeLastComma(text);
values = removeLastComma(values);
}
if (count == items.get_count())
{
text = "All Status";
//chkAll
var chkHeader = $get(combo.get_id() + "_Header" + "_chkAll");
chkHeader.checked = true;
}
if (count > 1 && count != items.get_count()) {
var chkHeader = $get(combo.get_id() + "_Header" + "_chkAll");
chkHeader.checked = false;
}
if (count == 0) {
text = "No selection";
}
if (text.length > 0) {
combo.set_text(text);
}
else {
combo.set_text("");
}
}
var supressDropDownClosing = false;
function StopPropagation(e) {
//cancel bubbling
e.cancelBubble = true;
if (e.stopPropagation) {
e.stopPropagation();
}
}
function removeLastComma(str) {
return str.replace(/,$/, "");
}
function OnClientDropDownClosing(sender, eventArgs) {
eventArgs.set_cancel(supressDropDownClosing);
}
function OnClientSelectedIndexChanging(sender, eventArgs) {
eventArgs.set_cancel(supressDropDownClosing);
}
function OnClientDropDownOpening(sender, eventArgs) {
supressDropDownClosing = true;
}
function OnClientBlur(sender) {
supressDropDownClosing = false;
sender.toggleDropDown();
}
</script>
<telerik:RadComboBox DataSourceID="dsTestData" DataTextField="Name" ID="radCentral" runat="server"
AllowCustomText="true" ExpandAnimation-Type="None" CollapseAnimation-Type="None">
Any idea why the autocomplete does not work?
Thanks