Solved

Need to convert boolean value into radiobutton in gridview

Posted on 2008-10-28
5
491 Views
Last Modified: 2012-05-05
I have gridview. My gridview is bound to List<t> where T is my business object. My t contains a boolean property. I need to bound my gridview to this boolean property with radio button.

How can i do that.

Thanks,
0
Comment
Question by:dj_user4
  • 3
  • 2
5 Comments
 
LVL 26

Expert Comment

by:Anurag Thakur
ID: 22821139
have a look at this
the following sample show hwo to show radio buttons in the grid view
http://www.codeproject.com/KB/webforms/GridViewRadiobuttons.aspx
0
 

Author Comment

by:dj_user4
ID: 22821158
i already saw this article. Problem is
<input type="radio" name="radNormalCompany" value='<%# Eval("isNotGeneralNewsCompany")%>' />

this property is populated with default value true but then also, my radio button comes as not selected.
0
 
LVL 26

Expert Comment

by:Anurag Thakur
ID: 22821198
try using asp:radiobutton instead of input type
<asp:RadioButton ID="radNormalCompany" runat="server" Checked='<%# Eval("isNotGeneralNewsCompany")%>'/>
0
 

Author Comment

by:dj_user4
ID: 22821267
Hmm. asp:radiobutton works.

Now i need to group my radiobutton per row. I have two radio button column in my gridview.
0
 
LVL 26

Accepted Solution

by:
Anurag Thakur earned 500 total points
ID: 22821329
you will have to figure it out urself as i have never worked with the radiobuttonlist in a gridview sorry
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: Ivo
C# And Nullable Types Since 2.0 C# has Nullable(T) Generic Structure. The idea behind is to allow value type objects to have null values just like reference types have. This concerns scenarios where not all data sources have values (like a databa…
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.
Delivering innovative fully-managed cloud services for mission-critical applications requires expertise in multiple areas plus vision and commitment. Meet a few of the people behind the quality services of Concerto.

919 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now