• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 497
  • Last Modified:

Need to convert boolean value into radiobutton in gridview

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
dj_user4
Asked:
dj_user4
  • 3
  • 2
1 Solution
 
Anurag ThakurTechnical ManagerCommented:
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
 
dj_user4Author Commented:
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
 
Anurag ThakurTechnical ManagerCommented:
try using asp:radiobutton instead of input type
<asp:RadioButton ID="radNormalCompany" runat="server" Checked='<%# Eval("isNotGeneralNewsCompany")%>'/>
0
 
dj_user4Author Commented:
Hmm. asp:radiobutton works.

Now i need to group my radiobutton per row. I have two radio button column in my gridview.
0
 
Anurag ThakurTechnical ManagerCommented:
you will have to figure it out urself as i have never worked with the radiobuttonlist in a gridview sorry
0

Featured Post

Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now