Hello,
I am currently working with the RadListView components.
I am trying to make a textbox visible or not from the result of a preceding textbox.
if tb1.text = “CE”
then tb2.visible = false
Currently I am having null pointer exception returns. The problem is that by the standard methods of binding the result to a String returns an object and not a string (even with the .ToString() argument). How can i resolve this problem?
'Retreive the list of functions in my DB then : If FunctionList.Count <> 0 Then Me.RadGridFunctions.DataSource = FunctionList Else Me.RadGridFonctions List(Of Fonction) End If Me.RadGridFunctions.DataBind()<head> <title></title> <script type="text/javascript"> function openWin() { window.radopen("Default5.aspx", "UserListDialog"); return false; } </script> </head> <body> <form id="form1" runat="server"> <telerik:RadScriptManager ID="sc1" runat="server"> </telerik:RadScriptManager> <telerik:RadWindowManager ID="RadWindowManager1" runat="server" > <Windows> <telerik:RadWindow ID="UserListDialog" runat="server" Height="320px" Width="550px" Left="150px" /> </Windows> </telerik:RadWindowManager> <asp:Button ID="aspButton" runat="server" Text="aspButton" /> <telerik:RadButton ID="radButton" runat="server" Text="radButton" /> </form> </body> Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load If Not IsPostBack Then Me.aspButton.Attributes.Add("onclick", "return openWin();return false;") Me.radButton.Attributes.Add("onclick", "return openWin();return false;") End If End SubDim ds1 As New DataSet
ds1 = dsDemo("demo","demo")
RadGrid1.DataSource = ds1.Tables(0).DefaultView
End Sub
Webpage error details
User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.2; Trident/4.0; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; InfoPath.2; MS-RTC EA 2)
Timestamp: Thu, 18 Aug 2011 04:00:16 UTC
Message: Sys.InvalidOperationException: A control is already associated with the element.
Line: 6580
Char: 49
Code: 0
URI: http://server1:9001/ScriptResource.axd?d=kWGs-RUk2zQKppldQIv5LEL-ZbidAjrVVoqsnTFQktf3_jYqeTWWcpOKfkyQ2k1ZwQY0SbG6gXq1eT68DL9beP5qF61LX4SPvyQFZ0ykAIj1wlyuze_fEG9W1DziucrZWPHju4oLYbjd_H_O7J_8O5F4pU_h4qybXdbqYJ5qrlgYfo5f0&t=ffffffffdca79b6e
if (!Page.IsPostBack) { MembershipUserCollection uc = Membership.GetAllUsers(); RadGrid1.DataSource = uc; RadGrid1.DataBind(); }<telerik:RadTabStrip ID="RadTabInfoGral" runat="server" MultiPageID="RadMultiPage1" OnTabClick="RadTabInfoGral_TabClick" Orientation="HorizontalBottom" Skin="Default" Visible="False" OnClientTabSelecting="onTabSelecting" SelectedIndex="0" OnClientTabUnSelected="OnClientTabUnSelected" Align="Right"> </telerik:RadTabStrip> <%--<telerik:RadTabStrip ID="RadTabStrip1" runat="server" SelectedIndex="0" Width="100%" OnTabClick="RadTabStrip1_TabClick" > <tabs> <telerik:RadTab runat="server" Selected="True" Text="Root RadTab1"> </telerik:RadTab> <telerik:RadTab runat="server" Text="Root RadTab2"> </telerik:RadTab> </tabs> </telerik:RadTabStrip>--%> <telerik:RadMultiPage ID="RadMultiPage1" runat="server" SelectedIndex="0" OnPageViewCreated="RadMultiPage1_PageViewCreated" Width="100%" ScrollBars="Vertical" Height="430px" Visible="False" > </telerik:RadMultiPage>private void AddTab(string tabName) { RadTab tab = new RadTab(); tab.Text = tabName; tab.SelectedImageUrl = "~/App_Themes/img/Informacion.gif"; RadTabInfoGral.Tabs.Add(tab); } private void AddPageView(RadTab tab) { //BARRO cada lista de controles, y cuando coincide el nombre de la pestaña con el de la lista //me salgo del foreach, y le asigno al pageView.ID, el nombre que en la base de datos coincide con fcFileControlId, //se cargó previamente en la inicialización de controles. foreach (string[] list in (List<string[]>)ViewState["listControlesID"]) { if (list[0].Equals(tab.Text)) { RadPageView pageView = new RadPageView(); pageView.ID = list[1]; RadMultiPage1.PageViews.Add(pageView); tab.PageViewID = pageView.ID; break; } } } protected void RadTabInfoGral_TabClick(object sender, RadTabStripEventArgs e) { AddPageView(e.Tab); e.Tab.PageView.Selected = true; protected void GeneraInfoGeneral() { //SI LE DAN CLICK EN EL BOTON DE INFORGRAL POR SEGUNDA VEZ MIENSTRAS ESTÉ MOSTRANDO if (!RadTabInfoGral.Visible) { RadTabInfoGral.Visible = true; //RadTabInfoGral.SelectedIndex = -1; PanelServidor.Visible = false; foreach (string[] StringArray in (List<string[]>)ViewState["listNombresPestañas"]) { AddTab(StringArray[2]); } RadMultiPage1.Visible = true; AddPageView(RadTabInfoGral.Tabs[0]); } } protected void anyImageButton_Click(object sender, ImageClickEventArgs e) { switch (((ImageButton)sender).ID) { case "btnServidorPublico": PanelServidor.Visible = true; RadTabInfoGral.Visible = false; RadMultiPage1.Visible = false; RadTabInfoGral.Tabs.Clear(); RadMultiPage1.PageViews.Clear(); break; case "btnInfoGral": GeneraInfoGeneral(); break; default: break; } }
protected void RadMultiPage1_PageViewCreated(object sender, Telerik.Web.UI.RadMultiPageEventArgs e) { string userControlName = "~/Controles/InformacionGeneral/" + e.PageView.ID + "CS.ascx"; string URL = string.Empty; string jScript = " function Muestra_div(x) {" + " if (document.getElementById(x).style.display == 'none')" + " { document.getElementById(x).style.display = 'block'; window.location.hash='#Link'+x;}" + " else " + " document.getElementById(x).style.display = 'none';}" + "function Oculta_Divs(ar){" + "for (i=0;i<ar.length;i++){" + " document.getElementById(ar[i]).style.display = 'none';}" + "}"; //string sUrlImagenFondo = string.Empty; Control userControl = Page.LoadControl(userControlName); userControl.ID = e.PageView.ID + "_userControl"; cDevuelveDatos devuelveDatos = new cDevuelveDatos(); devuelveDatos.UrlHTML((List<string[]>)ViewState["listArraytotal"], (List<string[]>)ViewState["listSubRubros"], e.PageView.ID); Literal literal1 = new Literal(); literal1.ID = "Literal1"; literal1.Text = devuelveDatos.sCadenaInformacion(Request.Url.Scheme + "://" + Request.Url.Host + Request.ApplicationPath, Server.HtmlEncode(Request.PhysicalApplicationPath),e.PageView.ID); ScriptManager.RegisterStartupScript(userControl.Page, userControl.Page.GetType(),"Key", jScript, true); //literal1.Text += "<a href=\"#\" onclick=\"Muestra_div('"+e.PageView.ID+"DivPrincipal')\">dd</a>"; userControl.Controls.Add(literal1); //((Literal)userControl.FindControl("literal01")).Text = literal1.Text; e.PageView.Controls.Add(userControl); }