.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Problem to group radio button across gridview rows

Posted By: Rahul     Posted Date: December 31, 2009    Points: 2   Category :ASP.Net
In general no one can easily group or make a single selection from radio button list inside gridview rows. There are a lot of way to make a single or unique selection from list. Here i want to share how i can address this problem in the most easiest way. Googling the problem most of the cases i saw the grouping in horizontal way. Thats why i tried to group the radio buttons in vertical manner. Let i have a requirement like below:

View Complete Post

More Related Resource Links

Maintain HTML Radio Button Selection Inside GridView After Postback

Long time ago I wrote an article about getting the value of the selected RadioButtons inside the GridView control. The code did not addresssed the postback issue which means that the selected radio button was cleared after the postback occurs.

A Simple and Extensible Radio Button Style GridView

The GridView is one of the significant controls in ASP.NET 2.0 and later versions. No doubt it reduces a lot of work time. However, customizing the GridView control is not an easy task. For example, it's hard to add a radio button column to the GridView. This article demonstrates the reason why a radio button column cannot act as normal and how to create a simple and extensible radio button GridView.

Editable Gridview with Textbox, CheckBox, Radio Button and DropDown List

This is an example of an editable gridview containing different ASP.NET controls. When user wants to edit values in gridview, she/he can use these controls to edit existing values in Gridview Edit Mode.

Using the Code

Gridview radio button

I am making an online train reservation system. I want to create a fare table (as seen in the link ) that will display fare of different classes based on the user selection of route. The fares should provide a radio button that will allow users to select which fare they would want to purchase. I am having trouble on how to show fares of the same schedule of different classes. I want to create something like the Eurostar fare tables. 

Selecting One Radio Button In A GridView

Hello, how do I add a RadioButton column to a gridview so that only one button is selectable? Here is what I have now. <asp:GridView ID="GridView2" runat="server" AutoGenerateColumns="false"> <Columns> <asp:TemplateField> <ItemTemplate> <asp:RadioButton ID="RadioButton2" runat="server" /> </ItemTemplate> </asp:TemplateField> <asp:HyperLinkField DataTextField="Text" DataNavigateUrlFields="NavigateURL" /> </Columns> </asp:GridView>  

radio button in gridview not storing the selected value


hi i have a grid view with radio button...schedule/approve/reject...by defualt schedule radio button is selected....but when i chage radio button selection option to anyth other than schedule it still store only schedule in DB.wats the pblm?could someone help me>

<asp:GridView ID="Gridgpapp"  runat="server" DataSourceID="ApprovalGp" AutoGenerateColumns="False" 
            AllowPaging="True" AllowSorting="True" BorderColor="#3366CC" BackColor="White" BorderStyle="None" 
            BorderWidth="2px" CellPadding="4" ShowFooter="True" EmptyDataText = "No Gatepass waiting for Approvals">
              <RowStyle BackColor="White" ForeColor="#003399" />
                   <FooterStyle BackColor="#99CCCC" ForeColor="#003399" />
                   <PagerStyle BackColor="#99CCCC"  HorizontalAlign="Left" />
                   <SelectedRowStyle BackColor="#009999" Font-Bold="True" ForeColor="#CCFF99" />
                   <HeaderStyle BackColor="#003399" Font-Bold="True" ForeColor="#CCCCFF" />

radio button group in infopath 2010

how i can have radio button group in infopath 2010 that user allow select one of them?

How can I clear all selected items of a radio button group in WPF - MVVM?

Hi I have a group of radio buttons bound to a property in View model. Now, on check of one of the button, i perform some action through property. My use case is when ever the action is failed, i want to reset checked button and set the earlier one. For this, i have reset the property value in seter itself but it is not reflected on UI. A workaround for this would be to clear all checked buttons from radio button group. How can we achieve it?? thanks in advance Swapnil

gridview checkbox group by problem



i am using this component http://www.agrinei.com/gridviewhelper/gridviewhelper_en.htm and it works great. The problem im facing is that i need to add a checkbox column(added dinamically) and group by that checkbox. I have added the checkbox using:

        <asp:GridView ID="GridView2" runat="server" AutoGenerateColumns="False" 
            OnSorting="GridView2_Sorting" >
                <asp:BoundField DataField="Client" HeaderText="Client" SortExpression="Client" />
                <asp:BoundField DataField="Description" HeaderText="Description" SortExpression="Description" />
                <asp:BoundField DataField="BilledBy" HeaderText="BilledBy" SortExpression="BilledBy" />
                        <asp:CheckBox ID="Include" runat="server" Text='<%# Eval("Project") %>' />

And as specified in the link, i use this code to make the grouping:

Problem adding multiple header rows to a gridview


Hello all!

I'm having difficulty adding a repeating header row, every x rows, to a gridview.  I'm able to add the header only once with the below code.  For some reason it will only add it during the last iteration through the for/next statement.  I tried manually adding three separate .addat statements to different rows and it only executed the last .addat statement.  I couldn't find any information on why it's only working the one time and I hope someone has a fix or better solution.

Thanks in advance!

Code snippet (Note the IsWhole() function verifies that the rownumber divided into a whole number):

Protected Sub Gridview1_DataBound(ByVal sender As Object, ByVal e As System.EventArgs) Handles Gridview.DataBound

        Dim grid As GridView = TryCast(sender, GridView)

        If grid IsNot Nothing Then

            Dim row As New GridViewRow(0, -1, DataControlRowType.Header, DataControlRowState.Normal)
            Dim header As GridViewRow = POSTURE_RESULT.HeaderRow
            For i As Integer = 0 To POSTURE_RESULT.Columns.C

Radio Button Select problem in a table


a Table contain

<table id="Grid_Event1" cellspacing="0" rules="all" border="1" style="font-family:verdana;font-size:11px;border-collapse:collapse;">
<th scope="col">FORMCODE</th><th scope="col">ID</th><th scope="col">COMPANY</th><th scope="col">OWNER</th

Adding Dynamic Rows in ASP.NET GridView Control with TextBoxes and with Delete functionality

In my previous examples, I have demonstrated on how to add dynamic rows in GridView control with TextBoxes and how to save the values into the database. Now, seems that most of the developers are asking if how to add a delete functionality with it. So in this example, I'm going to show on how to delete a certain row in the dynamic GridView with TextBoxes.

jQuery: Highlight Gridview Rows with Checkbox

Im learning and experimenting with jQuery and ASP.NET. Below is a simple solution I created to highlight rows in a gridview by clicking on a checkbox next to the row.

Gridview setup:

jQuery: Highlight Gridview Rows with Checkbox

Im learning and experimenting with jQuery and ASP.NET. Below is a simple solution I created to highlight rows in a gridview by clicking on a checkbox next to the row.

How to format and update GridView and DataGrid rows using JQuery

The behavior described in this question is as expected. When you set text of a cell in grid, it directly affects HTML that is going to be rendered. When you set text value of a cell, it means that you are setting innerText of the cell. The column that GridView creates for command fields (Edit, Delete and Select) are a (anchor) or button elements. So you can see what will happen if you set text value in that cell. It will wipe out those link or button controls and replace them with simple text string.

Insert Rows with a GridView

In ASP.NET version 1.x, I used the footer on the DataGrid control to insert new rows by placing a series of TextBox, DropDownLists, CheckBoxes etc. controls on it and then handling a save button. This also works with the GridView in version 2.0 but with one major exception: if your data source is empty, the GridView will hide your footer (and header) and only display the EmptyDataText.

Gridview with Radio Buttons

As now, Radio buttons are HTML controls, I am not able to get it on server side. When user select any radio button and press submit, Control will not available at code behind, you can use "e.Item.FindControl" as it is not "runat='server'". I want ID "Primary Key" value for selected radio button. To achive this I took the help of Javascript. I wrote javascript function that sets the values of "Primary Key" in hidden field when user clicks on any radio button. Now when user clicks on Submit button, user can get selected value froim hidden field.
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend