Forum guidelines
Amar Sharma
radio button
Posted By Amar Sharma on 14 Oct 2013
how to show the result in Radio Button from database.
I wants to show the gender in  radiobutton but that should be retrieved from database.

Re: radio button
Posted By Sakthis on 14 Oct 2013  
May this task helpful for u:-

if (listView1.SelectedItems.Count > 0)
                ListViewItem lvi = listView1.SelectedItems[0];
                txtEmpCode.Text = lvi.SubItems[0].Text;
                txtName.Text = lvi.SubItems[1].Text;
                if (lvi.SubItems[2].Text == "Male")
                    Male.Visible = true;  //Male is Radio Button
                    Female.Visible = false;  //Female is Radio Button
                else if (lvi.SubItems[2].Text == "Female")
                    Male.Visible = false;  //Male is Radio Button
                    Female.Visible = true; //Female is Radio Button
                txtEmpCode.Text = string.Empty;
                txtName.Text = string.Empty;               

C# Corner Annual Conference 2016


Spire.Doc - Free .NET Word API
Use Spire.Doc to create, read, write, print, and convert word documents to OpenXML, RTF, TXT, XPS, EPUB, EMF, HTML, Image and PDF.