Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. RadioButtonList won't show

RadioButtonList won't show

Scheduled Pinned Locked Moved ASP.NET
designsysadmin
2 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    thomasa
    wrote on last edited by
    #1

    Hey. I have a anthem:PlaceHolder inside a asp:Repeater that contains an asp:RadioButtonList something like <asp:repeater id="rp" runat="server" gt;<br="" mode="hold" />HeaderTemplate&gt table&gt;&lt;/HeaderTemplate ItemTemplate&gt; td><anthem:ImageButton id="ibPt" runat="server"></anthem:ImageButton> <anthem:PlaceHolder id="phPt" runat="server"> <asp:Literal ID="liPt" Runat="server"></asp:Literal> <asp:RadioButtonList ID="rblPt" Runat="server" Visible="False"></asp:RadioButtonList> </anthem:PlaceHolder></td And I have added a click event on my anthem:ImageButton that shall fill the RadioButtonList with items and make it Visible="true" something like private void OnPt(object sender, ImageClickEventArgs e) { MiBlo.Product bloProduct = null; Anthem.ImageButton aibtnPartType = (Anthem.ImageButton)sender; try { System.Web.UI.WebControls.RepeaterItem riSL = (System.Web.UI.WebControls.RepeaterItem)aibtnPartType.Parent; int lngProductID = int.Parse(aibtnPartType.CommandName); int lngCatalogID = int.Parse(aibtnPartType.CommandArgument); bloProduct = new MiBlo.Product(); DataView dvProductPartTypes = bloProduct.GetProductPartTypes(lngProductID, lngCatalogID); aibtnPartType.UpdateAfterCallBack = true; aibtnPartType.Visible = false; Anthem.PlaceHolder phPt = (Anthem.PlaceHolder)riSL.FindControl("phPt"); Literal liPt = (Literal)phPt.FindControl("liPt"); liPt.Text = ""; liPt.Visible = false; RadioButtonList rblPt = (RadioButtonList)phPt.FindControl("rblPt"); rblPt.Visible = true; rblPt.RepeatColumns = 1; for(int i = 0; i &lt; dvProductPartTypes.Count; i++) { RadioButton rb = new RadioButton(); rb.Text = dvProductPartTypes[i]["dblNumberInUnit"].ToString(); rb.GroupName = "rblPt"; rblPt.Controls.Add(rb); } phPt.UpdateAfterCallBack = true; } catch (Exception err) { lblMessage.Text += err.Message; }

    T 1 Reply Last reply
    0
    • T thomasa

      Hey. I have a anthem:PlaceHolder inside a asp:Repeater that contains an asp:RadioButtonList something like <asp:repeater id="rp" runat="server" gt;<br="" mode="hold" />HeaderTemplate&gt table&gt;&lt;/HeaderTemplate ItemTemplate&gt; td><anthem:ImageButton id="ibPt" runat="server"></anthem:ImageButton> <anthem:PlaceHolder id="phPt" runat="server"> <asp:Literal ID="liPt" Runat="server"></asp:Literal> <asp:RadioButtonList ID="rblPt" Runat="server" Visible="False"></asp:RadioButtonList> </anthem:PlaceHolder></td And I have added a click event on my anthem:ImageButton that shall fill the RadioButtonList with items and make it Visible="true" something like private void OnPt(object sender, ImageClickEventArgs e) { MiBlo.Product bloProduct = null; Anthem.ImageButton aibtnPartType = (Anthem.ImageButton)sender; try { System.Web.UI.WebControls.RepeaterItem riSL = (System.Web.UI.WebControls.RepeaterItem)aibtnPartType.Parent; int lngProductID = int.Parse(aibtnPartType.CommandName); int lngCatalogID = int.Parse(aibtnPartType.CommandArgument); bloProduct = new MiBlo.Product(); DataView dvProductPartTypes = bloProduct.GetProductPartTypes(lngProductID, lngCatalogID); aibtnPartType.UpdateAfterCallBack = true; aibtnPartType.Visible = false; Anthem.PlaceHolder phPt = (Anthem.PlaceHolder)riSL.FindControl("phPt"); Literal liPt = (Literal)phPt.FindControl("liPt"); liPt.Text = ""; liPt.Visible = false; RadioButtonList rblPt = (RadioButtonList)phPt.FindControl("rblPt"); rblPt.Visible = true; rblPt.RepeatColumns = 1; for(int i = 0; i &lt; dvProductPartTypes.Count; i++) { RadioButton rb = new RadioButton(); rb.Text = dvProductPartTypes[i]["dblNumberInUnit"].ToString(); rb.GroupName = "rblPt"; rblPt.Controls.Add(rb); } phPt.UpdateAfterCallBack = true; } catch (Exception err) { lblMessage.Text += err.Message; }

      T Offline
      T Offline
      thomasa
      wrote on last edited by
      #2

      It's not RadioButton one should add, but ListItems as in: for(int i = 0; i < dvProductPartTypes.Count; i++) { ListItem li = new ListItem(); li.Text = dvProductPartTypes[i]["dblNumberInUnit"].ToString(); rblPt.Items.Add(li); }

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups