<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
<script type="text/javascript">
function OnClientDropDownClosing(sender, args) {
// if (args.get_node().get_level() == 0)
// {
// args.set_cancel(true);
// }
// else {
var item = sender.get_items().getItem(0); // Get the first RadComboBoxItem
var treeView = item.findControl('tvDepartments'); // Find your RadTreeView
var checkedNodes = treeView.get_checkedNodes(); // Retrieve the checked items in the RadTreeView
var newText = '';
checkedNodes.forEach(function (node) { // Loop through the checked nodes. Requires jQuery!
if (newText != '') { newText += ', '; }
newText += node.get_text();
});
var comboBox = $find("<%= cbxDepartments.ClientID %>");
comboBox.set_text(newText); // Set the RadComboBox text
if ($.browser.msie) { // IE sometimes takes two tries for it to respond to new text
comboBox.set_text(newText);
// }
}
}
</script>
<telerik:RadComboBox ID="cboProvinciaT" runat="server" Width="200px" OnClientSelectedIndexChanging="LoadLocalidades" OnItemsRequested="cboProvinciaT_ItemsRequested" MarkFirstMatch="true" Skin="Sunset"></telerik:RadComboBox><telerik:RadComboBox ID="cboLocalidadT" runat="server" Width="200px" OnClientSelectedIndexChanging="LoadTiposVia" OnClientItemsRequested="ItemsLoaded" OnItemsRequested="cboLocalidadT_ItemsRequested" MarkFirstMatch="true" Skin="Sunset"></telerik:RadComboBox><telerik:RadComboBox ID="cboTipoViaT" runat="server" Width="80px" OnClientSelectedIndexChanged="LoadNombresVia" OnClientItemsRequested="ItemsLoaded" OnItemsRequested="cboTipoViaT_ItemsRequested" MarkFirstMatch="true" Skin="Sunset"></telerik:RadComboBox><telerik:RadComboBox ID="cboNombreVia" runat="server" OnClientItemsRequested="ItemsLoaded" OnItemsRequested="cboNombreVia_ItemsRequested" Filter="Contains" Skin="Sunset"></telerik:RadComboBox><script type="text/javascript"> var LocalidadesCombo; var TiposViaCombo; var NombresVia; function pageLoad() { LocalidadesCombo = $find("<%= cboLocalidadT.ClientID %>"); TiposViaCombo = $find("<%= cboTipoViaT.ClientID %>"); NombresVia = $find("<%= cboNombreVia.ClientID %>"); } function LoadLocalidades(sender, eventArgs) { var item = eventArgs.get_item(); LocalidadesCombo.set_text("Cargando..."); TiposViaCombo.clearSelection(); if (item.get_index() > 0) { LocalidadesCombo.requestItems(item.get_value(), false); LocalidadesCombo.clearSelection(); } else { LocalidadesCombo.set_text(" "); LocalidadesCombo.clearItems(); TiposViaCombo.set_text(" "); TiposViaCombo.clearItems(); } } function LoadTiposVia(sender, eventArgs) { var item = eventArgs.get_item(); TiposViaCombo.set_text("Cargando..."); TiposViaCombo.requestItems(item.get_value(), false); TiposViaCombo.clearSelection(); if (item.get_index() > 0) { TiposViaCombo.requestItems(item.get_value(), false); TiposViaCombo.clearSelection(); } else { TiposViaCombo.set_text(" "); TiposViaCombo.clearItems(); NombresVia.set_text(" "); NombresVia.clearItems(); } } function LoadNombresVia(sender, eventArgs) { var item = eventArgs.get_item(); NombresVia.set_text("Cargando..."); NombresVia.requestItems(item.get_value(), false); NombresVia.clearSelection(); } function ItemsLoaded(sender, eventArgs) { sender.showDropDown(); }</script>if (!Page.IsPostBack){ CargarProvincias(); //This method fill cboProvinciaT}else if (!Page.IsCallback){ LoadLocalidades(cboProvinciaT.SelectedValue); LoadTiposVia(cboLocalidadT.SelectedValue); LoadNombresVia(cboTipoViaT.SelectedValue);}#region Direcciónprotected void LoadLocalidades(string pIdProvincia){ try { AD.Motor mMotorAD = new AD.Motor(); DataTable mDT = new DataTable(); mDT = mMotorAD.ExecuteDataTable("Select 0 as ID, 'Localidad...' as Nombre union SELECT ID, Nombre FROM tlLocalidadDN where idProvincia=" + pIdProvincia + " ORDER BY Nombre ASC"); DataSet mDS = new DataSet(); mDS.Tables.Add(mDT); cboLocalidadT.DataTextField = "Nombre"; cboLocalidadT.DataValueField = "ID"; cboLocalidadT.DataSource = mDS.Tables[0]; cboLocalidadT.DataBind(); } catch (Exception ex) { throw ex; } }protected void LoadTiposVia(string pIdLocalidad){ try { AD.Motor mMotorAD = new AD.Motor(); DataTable mDT = new DataTable(); mDT = mMotorAD.ExecuteDataTable("Select 0 as ID, 'Vía..' as Nombre union SELECT ID, Nombre FROM tlTipoViaDN ORDER BY Nombre ASC"); DataSet mDS = new DataSet(); mDS.Tables.Add(mDT); cboTipoViaT.DataTextField = "Nombre"; cboTipoViaT.DataValueField = "ID"; cboTipoViaT.DataSource = mDS.Tables[0]; cboTipoViaT.DataBind(); } catch (Exception ex) { throw ex; }}protected void LoadNombresVia(string pIdTipoVia){ try { //HERE ALWAYS GET empty ("")
string mIdLocalidad = cboLocalidadT.SelectedValue;
AD.Motor mMotorAD = new AD.Motor(); DataTable mDT = new DataTable(); mDT = mMotorAD.ExecuteDataTable("Select 0 as ID, ' Nombre de la Vía..' as Nombre union SELECT ID, Nombre FROM tlViaDN where idLocalidad=" + mIdLocalidad + " and idTipovia=" + pIdTipoVia + " order by Nombre"); DataSet mDS = new DataSet(); mDS.Tables.Add(mDT); cboNombreVia.DataTextField = "Nombre"; cboNombreVia.DataValueField = "ID"; cboNombreVia.DataSource = mDS.Tables[0]; cboNombreVia.DataBind(); } catch (Exception ex) { throw ex; }}protected void LoadNombresVia(string pIdTipoVia, string pIdLocalidad){ try { AD.Motor mMotorAD = new AD.Motor(); DataTable mDT = new DataTable(); mDT = mMotorAD.ExecuteDataTable("Select 0 as ID, ' Nombre de la Vía..' as Nombre union SELECT ID, Nombre FROM tlViaDN where idLocalidad=" + pIdLocalidad + " and idTipovia=" + pIdTipoVia + " order by Nombre"); DataSet mDS = new DataSet(); mDS.Tables.Add(mDT); cboNombreVia.DataTextField = "Nombre"; cboNombreVia.DataValueField = "ID"; cboNombreVia.DataSource = mDS.Tables[0]; cboNombreVia.DataBind(); } catch (Exception ex) { throw ex; }}protected void cboNombreVia_ItemsRequested(object o, RadComboBoxItemsRequestedEventArgs e){ LoadNombresVia(e.Text);}protected void cboProvinciaT_ItemsRequested(object o, RadComboBoxItemsRequestedEventArgs e){ CargarProvincias();}protected void cboLocalidadT_ItemsRequested(object o, RadComboBoxItemsRequestedEventArgs e){ LoadLocalidades(e.Text);}protected void cboTipoViaT_ItemsRequested(object o, RadComboBoxItemsRequestedEventArgs e){ LoadTiposVia(e.Text);}#endregionprotected void LoadNombresVia(string pIdTipoVia) { try { //******************************************** //**** HERE ALWAYS GET EMPTY VALUE --> "" **** //******************************************** string mIdLocalidad = cboLocalidadT.Text; //******************************************** AD.Motor mMotorAD = new AD.Motor(); DataTable mDT = new DataTable(); mDT = mMotorAD.ExecuteDataTable("Select 0 as ID, ' Nombre de la Vía..' as Nombre union SELECT ID, Nombre FROM tlViaDN where idLocalidad=" + mIdLocalidad + " and idTipovia=" + pIdTipoVia + " order by Nombre"); DataSet mDS = new DataSet(); mDS.Tables.Add(mDT); cboNombreVia.DataTextField = "Nombre"; cboNombreVia.DataValueField = "ID"; cboNombreVia.DataSource = mDS.Tables[0]; cboNombreVia.DataBind(); } catch (Exception ex) { throw ex; } }<asp:panel id="div_projectsAssigned" runat="server" class="infoBox-projectsAssigned"> <telerik:RadTextBox ID="txtProjectsAssigned" runat="server" Text="0" BorderStyle="None" ReadOnly="True" Width="42" > <ClientEvents OnValueChanged="onValueChanged()" /> <ReadOnlyStyle HorizontalAlign="Center" BackColor="Transparent" ForeColor="White" Font-Bold="True" Font-Names="Segoe UI" Font-Size="12pt" Width="30px"> </ReadOnlyStyle> </telerik:RadTextBox></asp:panel>ClientEvents OnValueChanged="onValueChanged()" />
<script type="text/javascript"> function onValueChanged(sender, args) { if (args.get_oldvalue != args.get_newvalue) { thisDiv = $get("<%= div_projectsAssigned.ClientID %>"); esteDiv = "#" + thisDiv; animateDiv(thisDiv); } } function animateDiv(divToAnimate) { for (i = 1; i <= 3; i++) { $(divToAnimate).animate( { "opacity": "0.15" }, "slow"); $(divToAnimate).animate( { "opacity": "1.00" }, "slow"); } } </script><style type="text/css"> .style1 { color:Red !important; border:Blue; } </style> <form id="form1" runat="server"> <rad:RadScriptManager runat="server"></rad:RadScriptManager> <div> <asp:LinkButton ID="LinkButton1" runat="server" Text="Welcome"></asp:LinkButton> <rad:RadToolTip ID="Tooltip1" runat="server" Text="Hello Everyone" Enabled="true" CssClass="style1" Font-Size="Medium" TargetControlID="LinkButton1" RelativeTo="Element" Position="BottomCenter" AutoCloseDelay="2000" ShowEvent="OnMouseOver" EnableTheming="true" EnableEmbeddedSkins="true"></rad:RadToolTip> </div> </form>