471,348 Members | 1,357 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,348 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 6482
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 discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Oscar Monteiro | last post: by
6 posts views Thread by Craig Keightley | last post: by
reply views Thread by Krish | last post: by
3 posts views Thread by cpnet | last post: by
1 post views Thread by =?Utf-8?B?UGF0cmljayBG?= | last post: by
2 posts views Thread by dpazza | last post: by

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.