Я создал gridview
со списком переключателей.Выдает ошибку вроде
RadioButtonList2' has a SelectedValue which is invalid because it does not exist in the list of items.
Parameter name: value
И это мое кодирование для привязки в gridview
q = "SELECT
s.rollno,
s.studname,
d.deptname,
ct.ctype,
c.course,
s.status
FROM
dbmasdeptcreat d,
dbmascoursetypecreat ct,
dbmascoursecreat c,
dbmasstuddet s
WHERE
s.deptid=d.deptid AND
s.ctypeid=ct.ctypeid AND
s.cid=c.cid AND
s.status <> 'ACTIVE' AND
s.collname='" & lablcollname.Text & "'"
ds = c1.getDataset(q)
GridView2.DataSource = ds
GridView2.DataBind()
GridView2.Visible = True
И это мое кодирование источника gridview
<asp:GridView ID="GridView2" runat="server" AutoGenerateColumns="False" CellPadding="4" ForeColor="#333333" GridLines="None">
<AlternatingRowStyle BackColor="White" ForeColor="#284775" />
<Columns>
<asp:CommandField HeaderText="Edit" ShowEditButton="True" ShowHeader="True" />
<asp:BoundField DataField="rollno" HeaderText="Rollno" ReadOnly="True" />
<asp:BoundField DataField="studname" HeaderText="Student Name" ReadOnly="True" />
<asp:BoundField DataField="deptname" HeaderText="Department " ReadOnly="True" />
<asp:BoundField DataField="course" HeaderText="Course Type" ReadOnly="True" />
<asp:BoundField DataField="course" HeaderText="Course" ReadOnly="True" />
<asp:TemplateField HeaderText="Status">
<EditItemTemplate>
<asp:RadioButtonList ID="RadioButtonList2" runat="server" Text='<%# Bind("status") %>' >
<asp:ListItem>GUEST</asp:ListItem>
<asp:ListItem>REGULAR</asp:ListItem>
</asp:RadioButtonList>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label1" runat="server" Text='<%# Eval("status") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
</Columns>
<EditRowStyle BackColor="#999999" />
<FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
<HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
<PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
<RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
<SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
<SortedAscendingCellStyle BackColor="#E9E7E2" />
<SortedAscendingHeaderStyle BackColor="#506C8C" />
<SortedDescendingCellStyle BackColor="#FFFDF8" />
<SortedDescendingHeaderStyle BackColor="#6F8DAE" />
</asp:GridView>