473,544 Members | 2,231 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Trouble w/ GridView Radio buttons

Hello Gurus,

I have GridView control on web page which has couple of radio button
controls as one group. On editing a particular row in grid, i have to
validate based on user selection on radio button i have to validate another
column data in the grid. Pl. help me with code snippets. Thank you.

<asp:TemplateFi eld HeaderText="Cod e Translate">

<ItemTemplate >

<asp:RadioButto n GroupName="rdTr ans" id="rdTranslate P" runat="server"
Text='P' checked='<%# GetCheckP((stri ng)DataBinder.E val(Container.D ataItem,
"in_translate") ) %>' ToolTip="Perman ant" Enabled="False"/>

<asp:RadioButto n GroupName="rdTr ans" id="rdTranslate T" runat="server"
Text='T' checked='<%# GetCheckT((stri ng)DataBinder.E val(Container.D ataItem,
"in_translate") ) %>' ToolTip="Tempor ary" Enabled="False"/>

</ItemTemplate>

<EditItemTempla te>

<asp:RadioButto n GroupName="rdTr ansE" id="rdTranslate PE" runat="server"
Text='P' checked='<%# GetCheckP((stri ng)DataBinder.E val(Container.D ataItem,
"in_translate") ) %>' ToolTip="Perman ant"/>

<asp:RadioButto n GroupName="rdTr ansE" id="rdTranslate TE" runat="server"
Text='T' checked='<%# GetCheckT((stri ng)DataBinder.E val(Container.D ataItem,
"in_translate") ) %>' ToolTip="Tempor ary"/>

</EditItemTemplat e>

Jan 14 '06 #1
1 6574
got it...

bool brdP =
(GridView1.Rows[GridView1.EditI ndex].FindControl("r dTranslatePE") as
RadioButton).Ch ecked;

if (brdT)

{

if ((GridView1.Row s[GridView1.EditI ndex].FindControl("t xtDtExpire") as
TextBox).Text.T rim() == "")

{

lblMessage.Text = "Please enter Dt. Expire for Temporary translation";

lblMessage.Fore Color = Color.Red;

return;

}
}

"Krish" <vi************ ***@GMAIL.com> wrote in message
news:Ol******** *****@TK2MSFTNG P12.phx.gbl...
Hello Gurus,

I have GridView control on web page which has couple of radio button
controls as one group. On editing a particular row in grid, i have to
validate based on user selection on radio button i have to validate
another
column data in the grid. Pl. help me with code snippets. Thank you.

<asp:TemplateFi eld HeaderText="Cod e Translate">

<ItemTemplate >

<asp:RadioButto n GroupName="rdTr ans" id="rdTranslate P" runat="server"
Text='P' checked='<%#
GetCheckP((stri ng)DataBinder.E val(Container.D ataItem,
"in_translate") ) %>' ToolTip="Perman ant" Enabled="False"/>

<asp:RadioButto n GroupName="rdTr ans" id="rdTranslate T" runat="server"
Text='T' checked='<%#
GetCheckT((stri ng)DataBinder.E val(Container.D ataItem,
"in_translate") ) %>' ToolTip="Tempor ary" Enabled="False"/>

</ItemTemplate>

<EditItemTempla te>

<asp:RadioButto n GroupName="rdTr ansE" id="rdTranslate PE" runat="server"
Text='P' checked='<%#
GetCheckP((stri ng)DataBinder.E val(Container.D ataItem,
"in_translate") ) %>' ToolTip="Perman ant"/>

<asp:RadioButto n GroupName="rdTr ansE" id="rdTranslate TE" runat="server"
Text='T' checked='<%#
GetCheckT((stri ng)DataBinder.E val(Container.D ataItem,
"in_translate") ) %>' ToolTip="Tempor ary"/>

</EditItemTemplat e>

Jan 14 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
3260
by: Oscar Monteiro | last post by:
I Have to sets of Radio buttons like so: <input type="radio" name=p1 value=1> <input type="radio" name=p1 value=2> <input type="radio" name=p1 value=3> <br> <input type="radio" name=p2 value=1> <input type="radio" name=p2 value=2> <input type="radio" name=p2 value=3> then a text area and a button:
6
3265
by: Craig Keightley | last post by:
I have a page that has n number of radio groups (yes/No) how can i prevent the form being submitted if more than one radio group is not selected? By default all radio groups are unchecked The problem i am facing is that i do not know how many yes/no radio groups will be generated
2
11938
by: James P. | last post by:
Help, I need to display radio buttons on a form. The data is from SQL table: each row in each table is displayed as a radio button. I have multiple SQL tables so I understand I need to put them each in a GroupBox. All the examples I saw from the books or from the web show me how to add static radio buttons at design, or dynamically at...
0
1158
by: Krish | last post by:
Hello Gurus, I have GridView control on web page which has couple of radio button controls as one group. On editing a particular row in grid, i have to validate based on user selection on radio button i have to validate another column data in the grid. Pl. help me with code snippets. Thank you. <asp:TemplateField HeaderText="Code...
4
2306
by: Patrik | last post by:
hello, based on a client login I call a GridView that presents the appropriate questionnaire for that person. I added three columns (template fields) to the gridview that are radiobuttons. The client has to choose one radiobutton per row (either YES, NO, or PERHAPS). Yes would have a value of 1, No 2, perhaps 3. 1) I need to restrict the...
3
13383
by: cpnet | last post by:
I have a GridView which I'm populating from an ObjectDataSource (give the GridView a DataTable). The GridView will have about 20 rows, and only one editable column. The editable column consists of a RadioButtonList ("Yes", "No", "Not Answered") in a TemplateColumn. I want the user to be able to select a radio button for each row in the...
1
3872
by: =?Utf-8?B?UGF0cmljayBG?= | last post by:
I have a gridview on the page that i want to dynamically populate with radiobuttons, so i went out on the net and found something that works perfectly, it created radionuttons and the postback with the works. My problem is that i want to send 2 columns to the gridview instead of 1, but i cant figure out how to add the second column to the...
2
5880
by: dpazza | last post by:
Hi, I'm creating a quiz on using a form in VB 2005 express. I have four sets of questions and answers (labels and radio buttons) and I change between which set of questions is currently shown on the form by changing the visible state of the radio buttons and labels utilising back and next buttons. E.g. Next button makes current radio...
0
3207
by: chantigadu | last post by:
hi all, i am struck up with designing a page, that is i need to place a radio button in the gridview. if i place it directly i am able to select any number of radio buttons in that gridview. i need to check any one of them in the gridview. thanks in advance its urgent regards
7
3104
by: wktarin | last post by:
I've constructed a survey form, and I want to make the radio buttons sticky, so that if participants leave the page, they can return to find their answers still in tact. However, I can't seem to find the right code to make the radio buttons sticky. Below is the code I'm using. Any help would be appreciated. <p>Do you enjoy web designing?<br...
0
7438
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7374
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7632
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7783
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7392
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
4930
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3422
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1850
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
677
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.