Solved

Need to convert boolean value into radiobutton in gridview

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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
open System.IO.Compression.ZipArchiveEntry as ZipFile without storing to file 2 86
Hey Audio! 9 45
HttpPostedFile 1 30
Winform Module - What is the ASP.Net equiv 2 28
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…
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.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

820 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