I have used gridview in my aspx page.. In that I have a list with six radio buttons in a single cell aligned horizontally.
I need the 1st radio button to be hidden. How to achieve that programmatically?
<asp:GridView ID="CrowdRatingGrid" runat="server" AutoGenerateColumns="false" AllowPaging="true" PageSize="4" OnPageIndexChanging="CrowdRatingGrid_PageIndexChanging" ViewStateMode="Enabled">
<PagerSettings Mode="Numeric" PageButtonCount="4" />
<Columns>
<asp:TemplateField>
<HeaderTemplate>
Rating
</HeaderTemplate>
<ItemTemplate>
<asp:RadioButtonList runat="server" ID="Rating" SelectedValue='<%# Bind("rating_id") %>'
RepeatDirection="Horizontal">
<asp:ListItem Value="0" />
<asp:ListItem Value="1" />
<asp:ListItem Value="2" />
<asp:ListItem Value="3" />
<asp:ListItem Value="4" />
<asp:ListItem Value="5" />
</asp:RadioButtonList>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
I need the List Item with value=0 to be hidden. How would I achieve this?
RadioButtonList
but singleRadioButtons
. You can use a container control likePanel
and appropriate CSS for the layout. Use theGroupName
when only one selection is possible from a list of available options. – Peugia