Click here to Skip to main content
15,944,832 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
i have table:- code  : Name    :  Absence : Out   :  Vacation :  Date 
                             12144  : name1   :    true  : false :  false    : 28-8-2016
                             12111  : name2   :    False : false :  True     : 28-8-2016

i want create columns radio botton or checkbox but the user can't click more than one 
how i do that because i cant find radio button in gridview 

What I have tried:

i want know how i create radiobotton in the gridview?
Updated 18-Aug-16 20:25pm
MahmoudOmar 18-Aug-16 4:37am    
windows application not
Karthik_Mahalingam 18-Aug-16 4:39am    
gridview is used in where as datagridview in windows,
Please specify it in the question. so that the users will pay more attention to it.

If you are using GridView in WPF, you may add radio buttons to a data-bound column ("IsSelected") in this way:

<listview itemssource="{Binding Items}">
                    <gridviewcolumn header="Selected">
                                <radiobutton ischecked="{Binding IsSelected}" groupname="IsSelected" />
                    <gridviewcolumn header="Name">
                      DisplayMemberBinding="{Binding Name}" />
Share this answer
<asp:GridView ID="GridView1" runat="server"
HeaderStyle-BackColor = "green"
AutoGenerateColumns = "false" Font-Names = "Arial"
OnPageIndexChanging = "OnPaging"
Font-Size = "11pt" AlternatingRowStyle-BackColor = "#C2D69B"
AllowPaging = "true">
    <asp:RadioButton ID="RadioButton1" runat="server"
        onclick = "RadioCheck(this);"/>
    <asp:HiddenField ID="HiddenField1" runat="server"
        Value = '<%#Eval("CustomerID")%>' />
<asp:BoundField ItemStyle-Width="150px" DataField="CustomerID"
    HeaderText="CustomerID"  />
<asp:BoundField ItemStyle-Width="150px" DataField="City"
    HeaderText="City" />
<asp:BoundField ItemStyle-Width="150px" DataField="PostalCode"
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900