or
| I have a combobox as displayed below, and I was wondering if there is a setting to control the minimum number of characters to display before the service gets called. In other words, I would like to call the service only after the user typed in 3 or more characters. Also, when the control initially loads, there are no rows, as soon as I start typing, a blank drop down appears. Is there a way to supress the display the dropdown if there are no rows? <script type="text/javascript"> |
| function OnClientItemsRequesting(sender, eventArgs) { |
| var context = eventArgs.get_context(); |
| context["prefixText"] = eventArgs.get_text(); |
| } |
| </script> |
| <telerik:RadComboBox ID="rcCompany" runat="server" |
| AllowCustomText="true" |
| DataTextField="Name" |
| DataValueField="CompanyId" |
| Height="200px" |
| Width="400px" |
| DropDownWidth="400px" |
| MarkFirstMatch="true" |
| Text='<%# Bind("CompanyName") %>' |
| EnableLoadOnDemand="true" |
| ShowMoreResultsBox="true" |
| EnableVirtualScrolling="true" |
| OnClientItemsRequesting="OnClientItemsRequesting"> |
| <WebServiceSettings Method="GetCompletionList" |
| Path="AutoCompleteCompany.asmx" /> |
| </telerik:RadComboBox> |
| ... | |
| <telerik:RadAjaxPanel ID="AjaxPanel1" runat="server" Height="200px" Width="300px"> | |
| <telerik:RadComboBox ID="ChartSelector" runat="server" Height="150px" Width="200" OnClientDropDownOpened="OnClientDropDownOpenedHandler"> | |
| <ItemTemplate> | |
| <div id="div1"> | |
| <telerik:RadTreeView ID="Charts" runat="server" OnClientNodeClicking="nodeClicking"> | |
| </telerik:RadTreeView> | |
| </div> | |
| </ItemTemplate> | |
| <Items> | |
| <telerik:RadComboBoxItem Text="" /> | |
| </Items> | |
| </telerik:RadComboBox> | |
| </telerik:RadAjaxPanel> | |
| ... |
| protected void Page_Load(object sender, EventArgs e) | |
| { | |
| ScriptManager.RegisterClientScriptBlock(Page, Page.GetType(), "RadDropDownFunc", | |
| "function comboLoad(sender, eventArgs){sender.set_text(sender.get_items().getItem(0).get_value());}"+ | |
| "function StopPropagation(e){if (!e) {e = window.event;}e.cancelBubble = true;}"+ | |
| string.Format("function OnClientDropDownOpenedHandler(sender, eventArgs){var tree = sender.get_items().getItem(0).findControl('{0}'); var selectedNode = tree.get_selectedNode(); if (selectedNode){selectedNode.scrollIntoView();}}",this.ChartSelector.ClientID), | |
| true); | |
| LoadData(); | |
| } | |
| public void LoadData() | |
| { | |
| ChartSelectorData = new List<ChartListItem> | |
| { | |
| new ChartListItem { Text = "Nodo 1", NodeID=1 , ParentID=0}, | |
| new ChartListItem { Text = "Nodo 2", NodeID=2 , ParentID=0}, | |
| new ChartListItem { Text = "Nodo 3", NodeID=3 , ParentID=0}, | |
| new ChartListItem { Text = "Nodo 1-1", NodeID=4 , ParentID=1}, | |
| new ChartListItem { Text = "Nodo 1-2", NodeID=5 , ParentID=1}, | |
| new ChartListItem { Text = "Nodo 2-1", NodeID=6 , ParentID=2}, | |
| new ChartListItem { Text = "Nodo 2-2", NodeID=7 , ParentID=2}, | |
| new ChartListItem { Text = "Nodo 3-1", NodeID=8 , ParentID=3} | |
| }; | |
| ChartSelectorDataBind(); | |
| ChartSelectorInitialize(); | |
| } | |
| private void ChartSelectorDataBind() | |
| { | |
| RadTreeView tree = GetChartSelectorTreeView(); | |
| tree.DataTextField = "Text"; | |
| tree.DataNavigateUrlField = ""; | |
| tree.DataFieldID = "NodeID"; | |
| tree.DataFieldParentID = "ParentID"; | |
| tree.DataSource = ChartSelectorData; | |
| tree.DataBind(); | |
| } | |
| private void ChartSelectorInitialize() | |
| { | |
| RadTreeView tree = GetChartSelectorTreeView(); | |
| foreach (RadTreeNode Node in tree.GetAllNodes()) | |
| { | |
| if (Node.Nodes.Count == 0) | |
| { | |
| Node.ImageUrl = "~/Includes/Skin/Default/chart.gif"; | |
| } | |
| } | |
| } | |
| private RadTreeView GetChartSelectorTreeView() | |
| { | |
| return (RadTreeView)ChartSelector.Items[0].FindControl("Charts"); | |
| } |
| protected void Button1_Click(object sender, EventArgs e) | |
| { | |
| chartWidget = LoadControl("~/widgets/ChartWidget.ascx", new object[] { }) as ChartWidget; | |
| chartWidget.LoadData(); | |
| Panel1.Controls.Clear(); | |
| Panel1.Controls.Add(chartWidget); | |
| } | |
| private UserControl LoadControl(string UserControlPath, params object[] constructorParameters) | |
| { | |
| List<Type> constParamTypes = new List<Type>(); | |
| foreach (object constParam in constructorParameters) | |
| { | |
| if (constParam != null) | |
| constParamTypes.Add(constParam.GetType()); | |
| } | |
| UserControl ctl = Page.LoadControl(UserControlPath) as UserControl; | |
| ConstructorInfo constructor = ctl.GetType().BaseType.GetConstructor(constParamTypes.ToArray()); | |
| constructor.Invoke(ctl, constructorParameters); | |
| return ctl; | |
| } |
| ... | |
| <asp:ScriptManager ID="ScriptManager1" runat="server"> | |
| </asp:ScriptManager> | |
| <telerik:RadAjaxManager ID="AjaxManager1" runat="server"> | |
| <AjaxSettings> | |
| <telerik:AjaxSetting AjaxControlID="Button1"> | |
| <UpdatedControls> | |
| <telerik:AjaxUpdatedControl ControlID="Panel1" /> | |
| </UpdatedControls> | |
| </telerik:AjaxSetting> | |
| </AjaxSettings> | |
| </telerik:RadAjaxManager> | |
| ... | |
| <asp:Button ID="Button1" runat="server" Text="Button" onclick="Button1_Click" /> | |
| .. | |
| <asp:Panel ID="Panel1" runat="server"> | |
| </asp:Panel> |

<telerik:GridButtonColumn CommandArgument="DETPRO" CommandName="Jpro" ButtonType="ImageButton"
UniqueName="ProButton" ImageUrl="~/img/icon_info.gif" HeaderText="Pro" />
what I would like to do is add the icon_info.gif image to a css file and use it from there, how would I do that, or can it not be done ?
please provide a small example.
thanks