c# - How to get value in textbox based on Radibutton Checked and how to get radibutton gets checked when value given in Textbox in GRIDVIEW in asp.net -


I have one task to do this ... in my gridview, there are QNO and Answers and Answers and Answers columns .. < / P>

Here when I check the radioabutan, then automatically the value in the text box (value in the mean 1,2,3,4,5) and vice versa (when I read 1 or 2 in the text box

My GridView Model is:

  & lt; ASP: Gridview id = "Gvquestions" runat = "server" CssClass = "Txt" ForeColor = "# 333333" c Redline = "workspace" cellpadding = "6" width = "720px" auto generated column = "false">  gt; & lt; ASP: boundfield header text = "question." Datafield = "membership ID "/> gt; & ATP: Boundfield header text =" question name "datafield =" subtype "/> & ATP: templatefiled header text =" see answer "> item theme & gt; ; & Lt; asp: RadioButtonList id = "rbtnanswerview" duplication direction = "horizontal" run = "server" & gt; & lt; asp: listItem text = "" value = "1" & gt; & Lt; / Asp: ListItem & gt; & Lt; Asp: ListItem Text = "Value =" 2 "& gt; & Lt; / Asp: ListItem & gt; & Lt; Asp: ListItem Text = "Value" "3" & gt; & Lt; / Asp: ListItem & gt; & Lt; Asp: ListItem Text = "Value" "4" & gt; & Lt; / Asp: ListItem & gt; & Lt; Asp: ListItem text = "value" = "5" & gt; & Lt; / Asp: ListItem & gt; & Lt; / ASP: RadioButtonList & gt; & Lt; / ItemTemplate & gt; & Lt; / ASP: TemplateField & gt; & Lt; Asp: TemplateField HeaderText = "Answer" & gt; & Lt; ItemTemplate & gt; & Lt; ASP: Text Box ID = "TextSaintview" width = "40px" runat = "server" & gt; & Lt; / Asp: text box & gt; & Lt; / ItemTemplate & gt; & Lt; / ASP: TemplateField & gt; & Lt; / Column & gt; & Lt; EditRowStyle BackColor = "# 999999" /> & Lt; FooterStyle BackColor = "# 5D7B9D" font-bold = "true" ForeColor = "white" /> & Lt; HeaderStyle BackColor = "# 5D7B9D" font-bold = "true" ForeColor = "white" /> & Lt; PagerStyle BackColor = "# 284775" ForeColor = "White" horizontal alliance = "center" /> & Lt; RowStyle BackColor = "# F7F6F3" ForeColor = "# 333333" /> & Lt; Selected light backcollger = "# E2DED6" font-bold = "True" Foreclosure = "# 333333" /> & Lt; Sorted spacecale stylebackcroller = "#E9E7E2" /> & Lt; Sorted Heading Style Style BackAllore = "# 506C8C" /> & Lt; Sorted folding sequestale backAcllor = "#FFFDF8" /> & Lt; Sorted praying header printer backend = "# 6F8DAE" /> & Lt; / ASP: GridView & gt;  

Enter image details here

You have to use Gridview's FindControl function. Radiobutton list rbl = gridview.findcontrol ("rblName"); Text box txt = gridview.findcontrol ("txtname");


Comments

Popular posts from this blog

sqlite3 - UPDATE a table from the SELECT of another one -

c# - Showing a SelectedItem's Property -

javascript - Render HTML after each iteration in loop -