I am designing a page containing a gridview that takes the data from a dataSource
the data are evaluation questions (20 questions) and the answers are degree of five represented by radiobuttons

I added the radio buttons to the gridview as template item

Like this :

<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False"
CellPadding="4" DataKeyNames="question#" DataSourceID="SqlDataSource" ForeColor="#333333"
GridLines="None" Style="z-index: 102; right: 2px; position: relative; top: -41px" Width="649px" Height="199px">
<FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
<Columns>
<asp:BoundField DataField="question#" HeaderText="no " InsertVisible="False" ReadOnly="True"
SortExpression="question#" />
<asp:BoundField DataField="question" HeaderText="Question" SortExpression="question">
<ItemStyle HorizontalAlign="Right" />
</asp:BoundField>
<asp:TemplateField HeaderText="answers">
<ItemTemplate>
<asp:RadioButton ID="btn5" Text="excellent" runat="server" Font-Size="X-Small" GroupName="answer"/>
<asp:RadioButton ID="btn4" Text="v good" runat="server" Font-Size="X-Small" GroupName="answer"/>
<asp:RadioButton ID="btn3" Text="good" runat="server" Font-Size="X-Small" GroupName="answer"/>
<asp:RadioButton ID="btn2" Text="weekly good" runat="server" Font-Size="X-Small" GroupName="answer" />
<asp:RadioButton ID="btn1" Text="bad" runat="server" Font-Size="X-Small" GroupName="answer" />
</ItemTemplate>
<ItemStyle Width="230px" />
</asp:TemplateField>
</Columns>
<RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
<EditRowStyle BackColor="#999999" />
<SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
<PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
<HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
<AlternatingRowStyle BackColor="White" ForeColor="#284775" />

</asp:GridView>

but now I want to get the answer of each question but I have no idea how that could be accomplished :(

if some one has any idea please help me :)

Recommended Answers

All 5 Replies

Here is two websites for you that will answer your questions (I hope).

This will get you familiar with using SQL DataSource. Which I think you already know.
http://www.codersource.net/asp_net_gridviewcontrol.aspx

This website is going to show you how to use controls inside a GridView. The tutorial is specific on checkboxes. http://www.asp.net/learn/data-access/tutorial-52-vb.aspx

I can post some more code in detail but right now in a hurry.

thaaaaaaaank you veeery much :) it helped a lot


thanks again

If u r task is completed,why dont u mark the thread as solved.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.