So I helped him to fix.
<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 found the solution to remove the RadioButton particular List from the RadioButtonList using the following the steps
Rating.Items[0].Enabled = false;
Editing based on comment by OP. To completely get rid of it you'll need to do this:
Rating.Items.RemoveAt(0);
and then when you want it back you'll need to do this:
Rating.Items.Insert(0, "0");
No comments:
Post a Comment