Quantcast
Channel: Telerik Forums RSS
Viewing all articles
Browse latest Browse all 84751

Dynamic Controls, Ajax, and states

$
0
0
I am dynamically creating controls combobox and texbox using:
ce = form1.FindControl("cajaDinamico_" + lstDatosComboBoxDinamico[i].sDescripcion.ToLower());
                             
                            
                          
                           
                           if (ce is Telerik.Web.UI.RadTextBox)
 
                           {
                                  
                               ((Telerik.Web.UI.RadTextBox)ce).Visible = false;
                               ((Telerik.Web.UI.RadTextBox)ce).CssClass = "GMMSKIN";
                               ((Telerik.Web.UI.RadTextBox)ce).AutoPostBack = false;
                               ((Telerik.Web.UI.RadTextBox)ce).EnableEmbeddedSkins = false;
                               ((Telerik.Web.UI.RadTextBox)ce).MaxLength = 10;
                               ((Telerik.Web.UI.RadTextBox)ce).Skin = "GMMSkin";
                               ((Telerik.Web.UI.RadTextBox)ce).Height = 20;
                               ((Telerik.Web.UI.RadTextBox)ce).Width = 450;
                               ((Telerik.Web.UI.RadTextBox)ce).Label = "Suma AseguradaXX " + lstDatosComboBoxDinamico[i].sDescripcion;
                               ((Telerik.Web.UI.RadTextBox)ce).Text = "NA";
                               ((Telerik.Web.UI.RadTextBox)ce).ClientEvents.OnKeyPress = "solonumeros";
                           }
                           ce = form1.FindControl("cbDinamico_" + lstDatosComboBoxDinamico[i].sDescripcion.ToLower());
                           if (ce is Telerik.Web.UI.RadComboBox)
                           {
                               ((Telerik.Web.UI.RadComboBox)ce).Visible = true;
                               ((Telerik.Web.UI.RadComboBox)ce).AutoPostBack = false;
                               ((Telerik.Web.UI.RadComboBox)ce).MarkFirstMatch = true;
                               ((Telerik.Web.UI.RadComboBox)ce).HighlightTemplatedItems = true;
                               ((Telerik.Web.UI.RadComboBox)ce).EmptyMessage = "SeleccioneXX";
                               ((Telerik.Web.UI.RadComboBox)ce).NoWrap = true;
                               ((Telerik.Web.UI.RadComboBox)ce).ItemsPerRequest = 10;
                               ((Telerik.Web.UI.RadComboBox)ce).EnableVirtualScrolling = true;
                               ((Telerik.Web.UI.RadComboBox)ce).EnableEmbeddedSkins = false;
                               //((Telerik.Web.UI.RadComboBox)ce).RegisterWithScriptManager = true;
                               ((Telerik.Web.UI.RadComboBox)ce).Width = 500;
                               ((Telerik.Web.UI.RadComboBox)ce).Label = lstDatosComboBoxDinamico[i].sDescripcion.PadRight(dif, '.') + " : ";                               
                               ((Telerik.Web.UI.RadComboBox)ce).Skin = "GMMSkin";
 
                               List<ComboBoxCoberEnt> lstDatosCombos = new List<ComboBoxCoberEnt>();
                               lstDatosCombos = oDatosCombos.CargaValoresCoberturasDinamicas((List<AgrupadorComercialEnt>)ViewState["sListaAgrupador"], ViewState["sMoneda"].ToString(), ViewState["sPlan"].ToString(), lstDatosComboBoxDinamico[i].sDescripcion);
 
                               ((Telerik.Web.UI.RadComboBox)ce).Items.Clear();
                               ((Telerik.Web.UI.RadComboBox)ce).DataValueField = "sID";
                               ((Telerik.Web.UI.RadComboBox)ce).DataTextField = "sDescripcion";
                               ((Telerik.Web.UI.RadComboBox)ce).DataSource = lstDatosCombos;
                               //-----Falta el llenado del comobobox dependiente el tipo de cobertura, beneficio
 
                               ((Telerik.Web.UI.RadComboBox)ce).DataBind();
                           }
                       }
                   }
But right now I need you to select a value of comobobox "no" or other value , hide the texbox and otherwise show it . But I failed . Can you tell me how to do this .

Viewing all articles
Browse latest Browse all 84751

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>