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

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

validating radiobuttonlist inside gridview

Posted By:      Posted Date: September 20, 2010    Points: 0   Category :ASP.Net

I am sure this has been asked before but I cannot find a solution to my problem. I have a radiobuttonlist inside an itemtemplate inside my gridview. It contains a list of items with yes or no options. What I need to do is make sure all items were selected either 'Yes' or 'No' when I click a button. If some our left blank I want to stop them from proceeding and give them a message that not all questions are answered. Any ideas about how I could go about this or a different way that would be easier.

<asp:GridView ID="GridView1" CssClass="tabletext" Width

View Complete Post

More Related Resource Links

Validating DropdownList Inside Gridview Using Javascript

hi All,      I have Gridview with Dropdownlist which contains data as {select,1,2,3} .Gridview contains multiple rows of data.Submit button is also on form but outside gridview. If any of the rows of gridview dropdownlist contain value as "Select" and click Submit button ,give message as "Please select value". I want to do this stuff using javascript. Thanks in advance.

RadioButtonList inside the GridView control

Hi, I have several rows inside the GridView control and each row contains a RadioButtonList control. I select the option c from the RadiobuttonList but when I press submit I always get the first index of the RadiobuttonList which is a). Hence, the RadiobutonList is not maintaining the selected positions. Any idea how to maintain the value.

Accessing the different controls inside a GridView control

how we can access a particular control which resides inside a GridView control. In this article I will show you how you can access different controls inside a GridView control. We will see how we can access a TextBox control, a DropDownList control and a ListBox control. If you are working with ASP.NET 1.X then you might want to check out my article Accessing Different Controls Inside a DataGrid.

How To Add calendar control inside a GridView

This article show hot to add calendar control inside a GridView with code in c#

Using ATLAS PopUp Control with Calendar inside the GridView Control

In this video tutorial Mohammad demonstrates how you can access the Calendar control which is displayed using the ATLAS PopUp control inside the GridView control.

RadioButton inside GridView, How to get it work as normal

Did you tried before to drag a RadioButton control inside a Gridivew templatefield, and then you attempt to select these RadioButtons , you will notice that the behavior of RadioButton control will be changed and it will work just like the behavior of checkbox control! the user will be able to select more than one radiobutton in the grid!

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.

Textbox in ItemTemplate inside Gridview, unable to get the value


Hi. I have a itemtemplate inside a gridview.

<asp:TemplateField HeaderText="Enter OTP">
                            <asp:Label ID="Label2" runat="server"
                                style="font-family: Arial, Helvetica, sans-serif; font-size: x-small"
                                Text="PIN Num:"></asp:Label>
                            &nbsp;<asp:TextBox ID="txtPIN" runat="server" Height="21px" Width="100px"></asp:TextBox>

Gridview inside updatepanel


I am displaying large amount of data in gridview,the gridview placed within updatepanel,every 1sec i am refreshing updatepanel using ajax timer.my problem is while displaying large data the cpu performance is low,pls give idea to increase cpu performance..

find a Control inside a GridView using jQuery


I have databound GridView in my page and I have a hidden DIV in all rows. Each row contains a Button that I want it to make the DIV visible for me! how can I use that with jQuery?!

here is the code page: 

<asp:GridView ID="GridView2" runat="server" AutoGenerateColumns="False" 
                                EnableModelValidation="True" GridLines="None" ShowHeader="False" Width="100%">

how do i use javascript to change values of controls inside a gridview

i have 2 labels (lblRate,lblTotal) and a textbox (txtQuantity) in a itemtemplate of a gridview.I want to calculate the products of rate and quantity and show it in Total as the textbox loses focus...i cant use textchanged because i dont want the page to postback.How do i use javascript to achieve this??Please Help Urgently....<asp:TemplateField HeaderText="Rate">                <ItemTemplate>                    <asp:Label ID="lblRate" runat="server" Text='<%# Eval("Rate") %>' />                </ItemTemplate>            </asp:TemplateField> <asp:TemplateField HeaderText="Quantity">                <ItemTemplate>                    <asp:TextBox ID="txtQty" runat="server" />                </ItemTemplate>&

Editmode on GridView inside of ListView

I have a listview and inside the listview I have a gridview.  I'm binding data to the listview, then on the listview itemdatabound I'm binding the gridview. I want to make the gridview editable so I have an edit template and an edit command button.  I have the event rowediting and inside there I set the edit index. Now normally I rebind the control and everything works.  But if I rebind this gridview, nothing happens. I can trace through the rowediting and everything is working.  It's setting the edit index, it goes through the databind and gets the right data and binds it to the control. What is happening?  Why isn't my rebound edit mode gridview showing up?

How do I use a inside a field in my GridView?

hi all, I am trying to add RequiredFieldValidator in some of my fields when my GridView is in "EDIT mode".How do I do that? This is what I use inside a table cell on my FormView:<td> <asp:RequiredFieldValidator ID="SettingID_RFV" runat="server" Display="dynamic" ControlToValidate="txtbox1" ErrorMessage="ID is required" SetFocusOnError="True" ValidationGroup="ItemInsertItemTemplateVG"/>* </td> How do I add this inside the fields of my GridView?? Thank you      

binding datetimecontrol,dropdown,textbox inside gridview and update each gridviewrow

i have a web part with datetimecontrol(sharepoint) inside a  gridview. when the page loads this this gridview will be loaded with dtc control and the selecteddate would be one of the columns in the splist.also gridview contaisn dropdowns, textboxes, when an update button cliked inside grid, i need to save the info in the splist.  currently i am not getting the value  bound with dtc control. i am getting blank date inside dtc. though in the  rowdatabound event i amcapturing the values due to some reason i am not able to view the value in the DTCcontrol. can anybody give me help me how to achieve this? any  help links/ sample code.. appreciate the help                         

RowCommand not firing inside a GridView

Hello,  I'm trying to fire the RowCommand event on a DataGrid control.  I've previously done that, but not in this precise case.  Actually I'm working on someone else code so I can't really change the structure of his page excepted if it's really necessary. The code of the page is heavy, so I've summarized the problem in a small project and the page behaves the same way too.   Basically I have a GridView which I bind to a DataSet.  According to those data, I sometimes need to add, at the end of a row, a "Details" button (a LinkButton).  By pushing this button, I want to show a second GridView containing those details.  Let's add to this that the columns number of the first GridView is variable, those LinkButton need to be added dynamically.   The first GridView is generated without any problem and when my mouse is over one of the LinkButton, I can see that the link is something like "javascript:__doPostBack('dataGridView$ctl02$lnkDetail','')".  When I click on this link and debug step by step : Page_Init, Page_Load, OnPrerender, RowDataBound but no RowCommand, and I don't know why!   In the exemple, I've explicitly set the EnableViewState to true from what I've read here and there, but nothing's changed.   Here's my summarized problem and

Alert not working when used with image inside gridview

I am currently using following code to set alert on required column of my grid. When I change button type to Image the alert appear after completion action. Any quick suggestion??   My code is below.. protected void grdDelTempList_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { e.Row.Cells[6].Attributes.Add("onClick", "javascript:return confirm('Are You Sure?');"); } }    

Gridview Editing with dropdown lists inside

  Hi, Any good  Example for Editable Grid with dropdownlist inside ? Getting some problem in updating the data   Thanks 
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