5 Answers, 1 is accepted
0
Shinu
Top achievements
Rank 2
answered on 27 Jan 2011, 05:48 AM
Hello,
You can make use of client side api to show the dropdown on loading the RadComboBox. Invoke the "showDropDown()" method of RadComboBox client side object.
More information:
RadComboBox object
-Shinu.
You can make use of client side api to show the dropdown on loading the RadComboBox. Invoke the "showDropDown()" method of RadComboBox client side object.
More information:
RadComboBox object
-Shinu.
0
Hi jc mag,
Greetings,
Svetlina
the Telerik team
In addition, you should set the z-index to be bigger than the one of the RadToolTip - for your convenience I prepared for you a sample page which shows the approach:
<%@ Page Language="C#" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<
html
xmlns
=
"http://www.w3.org/1999/xhtml"
>
<
head
runat
=
"server"
>
<
title
></
title
>
<
style
type
=
"text/css"
>
html, body, form
{
height: 100%;
margin: 0px;
padding: 0px;
}
</
style
>
</
head
>
<
body
>
<
form
id
=
"form1"
runat
=
"server"
>
<
telerik:RadScriptManager
ID
=
"RadScriptManager1"
runat
=
"server"
>
</
telerik:RadScriptManager
>
<
script
type
=
"text/javascript"
>
function OnClientShow()
{
var combo = $find("<%= box.ClientID %>");
combo.showDropDown();
}
function OnClientHide()
{
var combo = $find("<%= box.ClientID %>");
combo.hideDropDown();
}
</
script
>
<
telerik:RadToolTip
ID
=
"tt"
runat
=
"server"
Width
=
"300"
Height
=
"300"
VisibleOnPageLoad
=
"true"
RelativeTo
=
"BrowserWindow"
OnClientShow
=
"OnClientShow"
OnClientHide
=
"OnClientHide"
>
<
telerik:RadComboBox
ID
=
"box"
runat
=
"server"
Style
=
"z-index: 10000"
>
<
Items
>
<
telerik:RadComboBoxItem
Text
=
"Test"
/>
<
telerik:RadComboBoxItem
Text
=
"Test"
/>
<
telerik:RadComboBoxItem
Text
=
"Test"
/>
<
telerik:RadComboBoxItem
Text
=
"Test"
/>
<
telerik:RadComboBoxItem
Text
=
"Test"
/>
<
telerik:RadComboBoxItem
Text
=
"Test"
/>
<
telerik:RadComboBoxItem
Text
=
"Test"
/>
<
telerik:RadComboBoxItem
Text
=
"Test"
/>
<
telerik:RadComboBoxItem
Text
=
"Test"
/>
<
telerik:RadComboBoxItem
Text
=
"Test"
/>
<
telerik:RadComboBoxItem
Text
=
"Test"
/>
</
Items
>
</
telerik:RadComboBox
>
</
telerik:RadToolTip
>
</
form
>
</
body
>
</
html
>
Svetlina
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
0
jc mag
Top achievements
Rank 1
answered on 31 Jan 2011, 03:12 PM
Thanks Svetlina for your sample, but actually my ComboBox is in a UserControl that I load like this:
How can I do in this case?
<
telerik:RadToolTipManager
ID
=
"tooltipSendBook"
runat
=
"server"
Skin
=
"Telerik"
ManualClose
=
"true"
OnAjaxUpdate
=
"tooltipSendBook_AjaxUpdate"
Position
=
"TopCenter"
Width
=
"360"
Height
=
"70"
>
</
telerik:RadToolTipManager
>
protected
void
tooltipSendBook_AjaxUpdate(
object
sender, ToolTipUpdateEventArgs e)
{
Control ctrl = Page.LoadControl(
"UserControls/ucSendNewsToBook.ascx"
);
e.UpdatePanel.ContentTemplateContainer.Controls.Add(ctrl);
}
How can I do in this case?
0
Hello jc mag,
Svetlina
the Telerik team
There are a few possible wayes to achieve what you want and they are related to general ASP.NET and MS AJAX knowledge when dealing with scripts.
For your convenience and for others who might have the same question, I prepared teh following sample code:
main page:
<%@ Page Language="C#" %>
<%@ Register TagPrefix="telerik" Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<
html
xmlns
=
"http://www.w3.org/1999/xhtml"
>
<
head
id
=
"Head1"
runat
=
"server"
>
<
title
></
title
>
<
style
type
=
"text/css"
>
html, body, form
{
height: 100%;
margin: 0px;
padding: 0px;
}
</
style
>
</
head
>
<
body
>
<
form
id
=
"form1"
runat
=
"server"
>
<
telerik:RadScriptManager
ID
=
"RadScriptManager1"
runat
=
"server"
>
</
telerik:RadScriptManager
>
<
script
type
=
"text/javascript"
>
var comboId = null;
function ShowDropDown(id)
{
setTimeout(function ()
{
var combo = $find(id);
combo.showDropDown();
comboId = id;
}, 500);
}
function OnClientHide()
{
if (!comboId) return;
var combo = $find(comboId);
combo.hideDropDown();
comboId = null;
}
</
script
>
<
script
type
=
"text/C#"
runat
=
"server"
>
protected void OnAjaxUpdate(object sender, ToolTipUpdateEventArgs e)
{
e.UpdatePanel.ContentTemplateContainer.Controls.Add(Page.LoadControl("WebUserControl1.ascx"));
}
</
script
>
<
asp:HyperLink
ID
=
"target"
runat
=
"server"
Text
=
"Show RadToolTip"
></
asp:HyperLink
>
<
telerik:RadToolTipManager
ID
=
"tt"
runat
=
"server"
Width
=
"300"
Height
=
"300"
RelativeTo
=
"BrowserWindow"
OnClientHide
=
"OnClientHide"
OnAjaxUpdate
=
"OnAjaxUpdate"
>
<
TargetControls
>
<
telerik:ToolTipTargetControl
TargetControlID
=
"target"
/>
</
TargetControls
>
</
telerik:RadToolTipManager
>
</
form
>
</
body
>
</
html
>
user control:
<%@ Control Language="C#" %>
<%@ Register TagPrefix="telerik" Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" %>
<
script
type
=
"text/C#"
runat
=
"server"
>
protected override void OnLoad(EventArgs e)
{
base.OnLoad(e);
ScriptManager.RegisterStartupScript(this, GetType(), "addScript", "ShowDropDown('" + box.ClientID + "');", true);
}
</
script
>
<
telerik:RadComboBox
ID
=
"box"
runat
=
"server"
Style
=
"z-index: 10000"
>
<
Items
>
<
telerik:RadComboBoxItem
Text
=
"Test"
/>
<
telerik:RadComboBoxItem
Text
=
"Test"
/>
<
telerik:RadComboBoxItem
Text
=
"Test"
/>
<
telerik:RadComboBoxItem
Text
=
"Test"
/>
<
telerik:RadComboBoxItem
Text
=
"Test"
/>
<
telerik:RadComboBoxItem
Text
=
"Test"
/>
<
telerik:RadComboBoxItem
Text
=
"Test"
/>
<
telerik:RadComboBoxItem
Text
=
"Test"
/>
<
telerik:RadComboBoxItem
Text
=
"Test"
/>
<
telerik:RadComboBoxItem
Text
=
"Test"
/>
<
telerik:RadComboBoxItem
Text
=
"Test"
/>
</
Items
>
</
telerik:RadComboBox
>
I also attached the relevant runnable files to the thread for your reference.
I hope that the code I prepared for you is helpful, let me know how it goes.
Svetlina
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
0
jc mag
Top achievements
Rank 1
answered on 03 Feb 2011, 05:27 PM
It works perfectly :) Thank you very much!