Solved

Need to convert boolean value into radiobutton in gridview

Posted on 2008-10-28
5
487 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

This article introduced a TextBox that supports transparent background.   Introduction TextBox is the most widely used control component in GUI design. Most GUI controls do not support transparent background and more or less do not have the…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

760 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

18 Experts available now in Live!

Get 1:1 Help Now