.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Code Snippets >> Visual Studio >> Post New Resource Bookmark and Share   

 Subscribe to Code Snippets

how to make item in radiobuttonlist to visible false or true

Posted By:Pravin       Posted Date: May 18, 2012    Points: 40    Category: Visual Studio    URL: http://www.dotnetspark.com  

There is no Visible property for radiobuttonlist.So here you know how we can set visible = 'false and true' to Radiobuttonlist items.
 

<asp:RadioButtonList ID="rdbMember" runat="server" CellPadding="15" Font-Size="15px" >
<asp:ListItem Value="rdblst1" Text="Free" ></asp:ListItem>
<asp:ListItem Value="rdblst2" Text="Symbol" ></asp:ListItem>
<asp:ListItem Value="rdblst3" Text="QC"></asp:ListItem>
<asp:ListItem Value="rdblst4" Text="Active"></asp:ListItem>
<asp:ListItem Value="rdblst5" Text="Flow"></asp:ListItem>
<asp:ListItem Value="rdblst6" Text="Call"></asp:ListItem>
</asp:RadioButtonList>


// Add a Style like below :
<style type="text/css">
    .hidden
    { 
       display:none;
    }
</style>

//Then set attribute to radiobuttonlist control like this,
//Put the below code in code behind where u need,this will make the control visible to false and true

rdbMember.Items[3].Attributes.Add("class", "hidden");

     

Further Readings:

Responses

No response found. Be the first to respond this post

Post Comment

You must Sign In To post reply
Find More code samples in C#, ASP.Net, Vb.Net and more Here

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend