Radiobuttons within Gridview

Reply

Join Date: Nov 2007
Posts: 84
Reputation: knowledgelover is an unknown quantity at this point 
Solved Threads: 0
knowledgelover knowledgelover is offline Offline
Junior Poster in Training

Radiobuttons within Gridview

 
0
  #1
Dec 20th, 2007
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
there's always something to learn
Reply With Quote Quick reply to this message  
Join Date: Apr 2006
Posts: 88
Reputation: blacklocist is an unknown quantity at this point 
Solved Threads: 2
blacklocist blacklocist is offline Offline
Junior Poster in Training

Re: Radiobuttons within Gridview

 
0
  #2
Dec 20th, 2007
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...ial-52-vb.aspx

I can post some more code in detail but right now in a hurry.
Reply With Quote Quick reply to this message  
Join Date: Apr 2007
Posts: 370
Reputation: greeny_1984 is an unknown quantity at this point 
Solved Threads: 29
greeny_1984's Avatar
greeny_1984 greeny_1984 is offline Offline
Posting Whiz

Re: Radiobuttons within Gridview

 
0
  #3
Dec 21st, 2007
Hi,
U didnt specify exactly wat u r problem was,but from my previous experience i had problem with radio button in a grid view.I wanted the radiobuttons to be under one group name and that task was not accomplished.I have used the following threads to solve the problem,hope they are useful

http://aspnet.4guysfromrolla.com/articles/122602-1.aspx

http://www.codeproject.com/aspnet/Ho...sp?msg=1188105
Reply With Quote Quick reply to this message  
Join Date: Nov 2007
Posts: 84
Reputation: knowledgelover is an unknown quantity at this point 
Solved Threads: 0
knowledgelover knowledgelover is offline Offline
Junior Poster in Training

Re: Radiobuttons within Gridview

 
0
  #4
Dec 23rd, 2007
thaaaaaaaank you veeery much it helped a lot


thanks again
there's always something to learn
Reply With Quote Quick reply to this message  
Join Date: Apr 2007
Posts: 370
Reputation: greeny_1984 is an unknown quantity at this point 
Solved Threads: 29
greeny_1984's Avatar
greeny_1984 greeny_1984 is offline Offline
Posting Whiz

Re: Radiobuttons within Gridview

 
0
  #5
Dec 24th, 2007
If u r task is completed,why dont u mark the thread as solved.
Reply With Quote Quick reply to this message  
Join Date: Apr 2009
Posts: 229
Reputation: mail2saion is an unknown quantity at this point 
Solved Threads: 36
mail2saion's Avatar
mail2saion mail2saion is offline Offline
Posting Whiz in Training

Re: Radiobuttons within Gridview

 
0
  #6
Apr 10th, 2009
HI,
SINCE THIS PROBLEM NOT MARKED YET I WANT TO SHARE MY EXPERIENCE. TODAY I RESOLVE THIS ISSUE BY THE FOLLOWING POST:
http://shawpnendu.blogspot.com/2009/...on-across.html

Hope It will help my frnds a lot.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Other Threads in the ASP.NET Forum


Views: 5828 | Replies: 5
Thread Tools Search this Thread



Tag cloud for ASP.NET
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC