473,396 Members | 1,914 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

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:TemplateField HeaderText="Code Translate">

<ItemTemplate>

<asp:RadioButton GroupName="rdTrans" id="rdTranslateP" runat="server"
Text='P' checked='<%# GetCheckP((string)DataBinder.Eval(Container.DataIt em,
"in_translate")) %>' ToolTip="Permanant" Enabled="False"/>

<asp:RadioButton GroupName="rdTrans" id="rdTranslateT" runat="server"
Text='T' checked='<%# GetCheckT((string)DataBinder.Eval(Container.DataIt em,
"in_translate")) %>' ToolTip="Temporary" Enabled="False"/>

</ItemTemplate>

<EditItemTemplate>

<asp:RadioButton GroupName="rdTransE" id="rdTranslatePE" runat="server"
Text='P' checked='<%# GetCheckP((string)DataBinder.Eval(Container.DataIt em,
"in_translate")) %>' ToolTip="Permanant"/>

<asp:RadioButton GroupName="rdTransE" id="rdTranslateTE" runat="server"
Text='T' checked='<%# GetCheckT((string)DataBinder.Eval(Container.DataIt em,
"in_translate")) %>' ToolTip="Temporary"/>

</EditItemTemplate>

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

bool brdP =
(GridView1.Rows[GridView1.EditIndex].FindControl("rdTranslatePE") as
RadioButton).Checked;

if (brdT)

{

if ((GridView1.Rows[GridView1.EditIndex].FindControl("txtDtExpire") as
TextBox).Text.Trim() == "")

{

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

lblMessage.ForeColor = Color.Red;

return;

}
}

"Krish" <vi***************@GMAIL.com> wrote in message
news:Ol*************@TK2MSFTNGP12.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:TemplateField HeaderText="Code Translate">

<ItemTemplate>

<asp:RadioButton GroupName="rdTrans" id="rdTranslateP" runat="server"
Text='P' checked='<%#
GetCheckP((string)DataBinder.Eval(Container.DataIt em,
"in_translate")) %>' ToolTip="Permanant" Enabled="False"/>

<asp:RadioButton GroupName="rdTrans" id="rdTranslateT" runat="server"
Text='T' checked='<%#
GetCheckT((string)DataBinder.Eval(Container.DataIt em,
"in_translate")) %>' ToolTip="Temporary" Enabled="False"/>

</ItemTemplate>

<EditItemTemplate>

<asp:RadioButton GroupName="rdTransE" id="rdTranslatePE" runat="server"
Text='P' checked='<%#
GetCheckP((string)DataBinder.Eval(Container.DataIt em,
"in_translate")) %>' ToolTip="Permanant"/>

<asp:RadioButton GroupName="rdTransE" id="rdTranslateTE" runat="server"
Text='T' checked='<%#
GetCheckT((string)DataBinder.Eval(Container.DataIt em,
"in_translate")) %>' ToolTip="Temporary"/>

</EditItemTemplate>

Jan 14 '06 #2

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

Similar topics

4
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>...
6
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 ...
2
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...
0
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...
4
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...
3
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...
1
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...
2
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...
0
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...
7
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...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...
0
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,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.